当前位置:网站首页>Distributed monomer brought by microservice architecture
Distributed monomer brought by microservice architecture
2022-06-21 15:38:00 【Chestnut Shao】
Distributed monomers brought by microservice architecture
Catalog
- Preface
- One 、 Good microservice Architecture
- Two 、 Distributed monomer architecture
- 3、 ... and 、 Solutions
Preface
The goal of microservice architecture is to develop services independently 、 Independent deployment , Fast iteration , And technological diversity .
However, we often fail to make clear the boundary of microservices when developing microservices , It leads to a bigger pit , from Monomer architecture Split into Microservice monomer architecture , Has brought even greater disaster : There is no shortage of pain in developing monomer , The benefits of service orientation are nowhere to be found . If we don't solve these problems , As the service ecosystem grows , Things are getting worse .
One 、 Good microservice Architecture

- Single responsibility , High cohesion and low coupling
- It can be developed independently 、 Independent deployment 、 Independent expansion and contraction capacity
- Has its own data storage , Independent database 、 cache 、 Resources such as message queues
- Speed up the iteration
Two 、 Distributed monomer architecture

Although the microservice architecture is very good , Very advanced , But the development process is often due to temporary emergency needs 、 The business personnel don't understand abstraction and other reasons, so they split it into a distributed monomer architecture
Coupling example

Left : service A Call the service B, service B Call the service C, then A Call the service again C To get the results
Right : service A Call the service B, service B dependent service C, And the service C And relying on services A. Dependency produces a ring
Such a structure will eventually become a distributed monomer , The following problems arise :
- Update both services at the same time , I don't know which one to update first , Because of interdependence .
- A simple logic may span multiple services . If something goes wrong , Only someone who knows more than one service can diagnose the problem
Bad local multi - service development model
Running most of the infrastructure locally , Very likely to encounter “ Unable to run ” The problem of
- Developers don't know how to run all the dependent services
- The configuration of developers can not support the running services
This is the development mode of the single architecture shown , Local people need to run everything , It becomes a micro service unit , Still need to run everything
Poor debugging and testing strategies
- Difficult to diagnose across networks . In normal development, it is only necessary to simply lower the breakpoint , It is very difficult to diagnose after becoming a distributed monomer , Open all kinds of projects and read the log , Lower breakpoint
- There is a problem with data synchronization between multiple services , Preparing data requires more time and effort
- Incorrect configuration , Connection timeout 、 Read write timeout 、 Number of work processes 、 Scalable configuration and so on .
- Difficult to simulate system interaction ( The message broker 、 Asynchronous queue, etc )
One of the benefits of the microservice architecture is to speed up iteration , If you waste a lot of energy on local debugging and testing , The meaning of microservices has been lost
High cost compensation measures
- Invest heavily in infrastructure and testing , To ensure that the data is synchronized correctly
- Do a lot of visibility and anomaly detection , Ensure that when synchronizing exceptions and alarms , Can diagnose and solve in time .
- Train developers , So they don't accidentally introduce changes that can cause data synchronization problems
- After enough data is synchronized between multiple services , Developers are bound to make mistakes ( Murphy's law )
3、 ... and 、 Solutions
The current architecture has gone wrong , The most important thing should be to analyze the maintenance cost of the current system 、 The relationship between the modification cost and the cost saved by the new system .
This is a difficult point , We should pay attention to some core indicators , for example
Focus on core indicators
- Delivery time
- Bug Number
- Downtime times
- Number of affected users
Make a migration plan
If the system is not well designed , Such a data coupling architecture has emerged , Make an architecture adjustment plan , Step by step Existing architecture Over to Target architecture
- Gradually merge the coupled services
- Gradually merge the coupled databases
- A large and comprehensive test , For example, black box 、CICD automated testing 、 unit testing 、 Stress testing, etc .
Reference material :Signs of Failing Service-Oriented Architecture
Link to the original text :https://www.cnblogs.com/chenqionghe/p/12965074.html
边栏推荐
- Bookstack: an open source wiki platform
- Analysis on the scale and market structure of China's bill financing industry in 2020 [figure]
- Fluent encapsulates an immersive navigation bar with customizable styles NavigationBar
- Learn upward management and four questioning skills to get twice the result with half the effort
- Operator Tour (I)
- GO语言-指针
- 【数据库】面试必备数据库笔试
- Practice of geospatial data in Nepal graph
- Counter: a simple and free network traffic analysis tool
- Algorithm question: interview question 32 - I. print binary tree from top to bottom (title + idea + code + comments) sequence traversal time and space 1ms to beat 97.84% of users once AC
猜你喜欢

Fluent encapsulates an immersive navigation bar with customizable styles NavigationBar

Gold, silver and four interviews are necessary. The "brand new" assault on the real topic collection has stabilized Alibaba Tencent bytes

C multithreading

Leetcode: number of good subsets (backtracking + state compression +dfs + pruning)

Browser evaluation: a free, simple and magical super browser - xiangtian browser

Build an efficient and scalable result cache

Phantom star VR product details 34: Happy pitching

Based on Transformer's artificial neural network, the image of organic structure is transformed into molecular structure

2022awe opened in March, and Hisense conference tablet was shortlisted for the review of EPLAN Award

ABP Framework 5.3.0 版本新增功能和变更说明
随机推荐
Fundamentals of C language 13: file input / output
What is the server room
Phantom star VR product details 34: Happy pitching
Research Report on the overall scale, major producers, major regions, products and application segments of active aluminum chloride in the global market in 2022
Fluent encapsulates an immersive navigation bar with customizable styles NavigationBar
Online keyboard key detection tool
Is it safe to open a securities account by downloading the app of qiniu school? Is there a risk?
Torch utils. Data: analyze the whole process of data processing
QT - basic knowledge
What is the confirmation date for the scheduled redemption of financial products?
GO语言-接口
MySQL memory tuning
Select everything between matching brackets in vs Code - select everything between matching brackets in vs Code
Factorial summation
New project template of punctual atom F103 based on firmware library
For the first time in China, Tsinghua and other teams won the wsdm2022 only best paper award, and Hong Kong Chinese won the "time test Award"
马拦过河卒
[Yugong series] February 2022 wechat applet -app Debug JSON configuration attribute
Jason Basics
Mysql5.7 add SSL authentication