当前位置:网站首页>Precipitation of architecture design methodology
Precipitation of architecture design methodology
2022-06-24 07:10:00 【vitofliu】
1. summary
The main purpose of Architecture Design : Solve the problems caused by the complexity of software system .
Sources of architectural design complexity : High performance 、 High availability 、 High scalability and low cost .
Principles of Architecture Design : appropriate 、 Simple 、 Evolution .
Architecture design process : Identify system complexity -> Design alternatives -> Evaluate and select alternatives -> Detailed scheme design
2. Capacity assessment
This is the basic skill of architecture design , What scenarios require capacity estimation 、 Capacity design ?
(1) Capacity has qualitative change and growth
(2) Temporary operational activities ( Like double 11, Spring Festival red envelopes )
(3) New system online
Evaluate which indicators ?
Look at the specific business , What is the main contradiction corresponding to the system test ? for example :
(1) Data volume ( News review , Video on demand platform )
(2) Concurrency , throughput (12306 Grab tickets , Rush to buy goods )
(3) bandwidth ( live broadcast , Push flow , Audio and video services )
(4)CPU/MEM/DISK IO etc.
How to evaluate capacity ?(QPS throughput )
1). Evaluate the total number of visits : Refer to product and operation estimation data
2). Evaluate average throughput : Total visits / Total time , Press... One day 4W second ( Total for one day 60x60x24=86400 second ; It is generally believed that requests occur during the day 4W second )
3). Evaluate peak throughput : Evaluate according to the business access curve ( This principle , Except for secsha and other special businesses )
4). Evaluate the maximum throughput of a single machine : Pressure measurement
5). Make decisions based on online redundancy : Calculate the difference between demand and online redundancy ( Disaster preparedness )
3. High performance
1). Common indicators of high performance
1. response time (Response Time)
2. throughput (Throughput)
3. Query rate per second QPS(Query Per Second)
4. Number of concurrent users
2). Ways to improve system performance :
1. Vertical expansion (Scale Up) Enhance single set hardware performance , Improve the performance of single set architecture
2. Horizontal expansion (Scale Out) Just increase the number of machines , The system performance can be linearly extended Each layer must support horizontal expansion , In theory, the performance is infinite .
3) . Common methods : Read / write separation , Dynamic and static separation ( Page static ), Database horizontal segmentation ( Horizontal sub table 、 sub-treasury ), High performance cache architecture , CDN Speed up .
CDN It is suitable for accelerating access to static resources : adopt “ intelligence DNS” To achieve ! intelligence DNS Through users ip To resolve the domain name to access nearby
4) Cache architecture
In process caching can save intranet bandwidth also Less delay , But ensure data consistency There's a lot of complexity . And violated ”” Service stateless ” Design criteria for , Data and status shall be stored in the back-end unified storage as far as possible .
When can I use in-process caching ?
1. Read only data
2. Concurrency is extremely high , The pressure at the rear end of transparent transmission is extremely high ( Second kill business )
3. Allow some degree of data inconsistency ( Counting service )
How to ensure the consistency of in-process cache ?
Scheme 1 : A single node notifies other nodes
The same function is coupled with multiple nodes in a cluster , When there are many nodes , The connection relationship can be complicated
Option two :MQ Decoupling , But introduce MQ System complexity increases
Option three : Abandon real-time consistency , Regularly update data from the back end
4. High availability
Cap theory
High availability HA(High Avaliability), It is a factor that must be considered in the design of distributed system architecture , How to ensure the high availability of the system ?
(1) clustering ( redundancy )
(2) Auto fail over
High Availability Storage Architecture : Dual architecture
High Availability Storage Architecture : Clusters and partitions
Business high availability guarantee : Live in different places
Master slave consistency , How to solve this problem ?
Causes of master-slave inconsistency : After the write request occurs , The data has not been synchronized to the slave database yet , A read request occurs immediately ( Master slave synchronization delay )
Master slave data redundancy , There is no agreement between the master and the slave :
1. negligible ( The service accepts reading old data within a very short delay )
2. Force the reader to ( Abandon read / write separation , One master multi slave grouping architecture ; Use caching to improve read performance , Introduce data inconsistency between cache and database )
3. With cache , Choose sex to read the Lord ( Read the master database within the delay range of master-slave synchronization , Otherwise, read and flush the library , Cache records written to the database , surface , Primary key )
The reason for the inconsistency between the principal and the principal : The primary database uses a self growing primary key ; Write requests occur simultaneously in two main databases , Auto increment primary key conflict , Synchronization failure , Cause permanent data loss
Master data redundancy , The master is inconsistent with the master :
1. Database autoincrement id Set different initial values , Same growth step
2. The application layer generates non conflicting id ( Snowflake algorithm, etc )
3. There is only one master library that provides services , The Shadow Lord does not serve ( Sacrifice resource utilization , Compromise between data consistency and resource utilization )
5. Highly scalable
The basic idea of extensibility : Split . Is to split the original unified system into multiple small-scale parts , You can only modify some of them when expanding , There is no need to change the whole system everywhere , In this way to reduce the scope of changes , Reduce the risk of changes .
Divide the software system according to different ideas , You'll get a different architecture . There are three common splitting ideas , Different ways of splitting , Will get different system architectures :
Facing process splitting : Layered architecture . Split the whole business process into several stages , Each stage as part of .
Service oriented splitting :SOA、 Microservices . Split the services provided by the system , Each service as part of .
Function oriented splitting : Microkernel architecture . Split the functions provided by the system , Each function as part of .
Architecture layered methodology :
(1) Layered architecture , It's a “ Data mobility ”, By “ Handle ”, Then be “ present ” The process of
(2) Architecture layered methodology :
Let the upstream obtain and process data more efficiently , Reuse
So that the downstream can shield the acquisition details of data , encapsulation
MQ ( The message bus ,Message queue) It is the most common structural weapon in the Internet architecture
6. Microservices
What are the benefits of servitization :
1. reusability , Eliminate code copies 2. Concentration , Prevent complexity from spreading
3. Decoupling , Eliminate common library coupling
4. High-quality ,SQL Guaranteed stability
5. Easy to expand , Eliminate database decoupling
6. high efficiency , The R & D efficiency of the caller is improved
But if the service is unreasonable , Sinking personalized data into the underlying microservices , Coupling and bottlenecks will become more serious .
How to decouple : Personalized code floats up , Public code sink , More thorough service !
边栏推荐
- 机器人迷雾之算力与智能
- puzzle(019.1)Hook、Gear
- Computing power and intelligence of robot fog
- EasyDSS_ The dash version solves the problem that the RTSP source address cannot play the video stream
- Online font converter what is the meaning of font conversion
- sql join的使用
- 年中了,准备了少量的自动化面试题,欢迎来自测
- RealNetworks vs. 微软:早期流媒体行业之争
- typescript vscode /bin/sh: ts-node: command not found
- Become TD hero, a superhero who changes the world with Technology | invitation from tdengine community
猜你喜欢

leetcode:1856. Maximum value of minimum product of subarray

You have a chance, here is a stage
![[Yugong series] June 2022 asp Basic introduction and use of cellreport reporting tool under net core](/img/18/1576cb7bdae5740828d1db5b283aee.png)
[Yugong series] June 2022 asp Basic introduction and use of cellreport reporting tool under net core

Spark project Packaging Optimization Practice

leetcode:84. The largest rectangle in the histogram

Typora收费?搭建VS Code MarkDown写作环境

Arduino融资3200万美元,进军企业市场

Challenges brought by maker education to teacher development

大厂不是衡量能力的唯一出路,上财学姐毕业三年的经验分享

2022蓝队HW初级面试题总结
随机推荐
NVIDIA control panel does not open what is NVIDIA control panel
c#:互斥锁的使用
Application of intelligent reservoir management based on 3D GIS system
oracle sql综合运用 习题
How do I reinstall the system? How to install win10 system with USB flash disk?
Intelligent Vision Group A4 paper recognition example
What is the main function of cloud disk? How to restore deleted pictures
Spark项目打包优化实践
Spark project Packaging Optimization Practice
In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
0 foundation a literature club low code development member management applet (II)
Online font converter what is the meaning of font conversion
High energy ahead: Figure 18 shows you how to use the waterfall chart to visually reflect data changes
FreeRTOS MPU使系统更健壮!
年中了,准备了少量的自动化面试题,欢迎来自测
Typora charges? Build vs Code markdown writing environment
.NET7之MiniAPI(特别篇) :Preview5优化了JWT验证(上)
Page Jump and database connection of student management system
Can the small fire Chunfeng tea make its debut by "keeping fit"?
An example of MySQL accidental deletion recovery - using Myflash