当前位置:网站首页>Expandable type of system
Expandable type of system
2022-06-11 19:03:00 【thoughtCodes】
Highly scalable design
Split , Break down the complex system into independent 、 A single responsibility module .
Pay attention to different types of modules , The principle of splitting is different . If you design a know , How many modules will there be ? At least 5 A module .
user : Responsible for maintaining community user information , register , Landing, etc ;
Relationship : Attention between users 、 Good friends 、 Maintenance of relations such as La Hei ;
Content : Content sent by the community , Just like the content of circle of friends or microblog ;
Comment on 、 Fabulous : There are two general interactions that users may have ;
Search for : User search , Content search .
The deployment method follows the simplest three-tier deployment architecture
Load balancing is responsible for the distribution of requests
The application server is responsible for the processing of business logic
The database is responsible for data storage
The business code of all modules is mixed , There is also a database for all data .
Scalability of the storage layer
Whether it's the amount of data stored , Or concurrent traffic , The magnitude of different business modules varies greatly .
For example, Zhihu , The amount of relational data is much larger than the amount of user data , However, the access volume of user data is much larger than that of relational data . So if the current bottleneck of storage is capacity , You only need to split the data of the relationship module , Without splitting the user module data . Therefore, the first consideration of storage splitting is the business dimension .
After break up , This simple community system has a user library 、 Content library 、 Comment Library 、 The library of praise and the library of relations . This also isolates faults , If a library hangs, it will not affect other DB.
Press DB Deployment architecture after business split
Business splitting improves the system scalability to a certain extent , But after a long run , Single business DB The capacity and concurrent requests will still exceed the single machine limit . Need for DB Make a second split .
This split is done horizontally according to the data characteristics , For example, add two nodes to the user library , Then split the user data into libraries .
After horizontal split , You can break through the single machine limit . Nodes cannot be added randomly , Because once you add nodes, you need to migrate data manually . Therefore, in the long run, it is best to add enough nodes at one time , Avoid frequent expansion .
When DB Split by business and data dimensions , Try not to use transactions . Because when a transaction updates different at the same time DB, A two-stage submission is required , To coordinate all DB Or all updates are successful , Or all updates fail .
Business layer scalability
Generally, the splitting scheme of the business layer is considered from three dimensions
Business latitude
Importance latitude
Request source latitude
First, you need to split the same business services into separate business pools , For example , It can be split into user pools according to business dimensions 、 Content pool 、 Relationship pool 、 Comment pool 、 Like pool and search pool .
Each business depends on its own DB resources , Will not rely on other businesses . In this way, when a business interface becomes a bottleneck , Just expand the business pool , And identify upstream and downstream dependent parties , Greatly reduce the expansion complexity .
According to the importance of business interface , Divide the business into core pool and non core pool . For example, relationship pool :
Focus on 、 It's relatively important to ignore the interface , Can be placed in the core pool
The operations of black pulling and canceling black pulling are relatively less important , It can be placed in the non core pool
This gives priority to core pool performance , When the overall flow increases, priority is given to expanding the core pool , Demote some non core pool interfaces , So as to ensure the stability of the whole system .
Diagram of relationship pool splitting
You can also split the service pool according to the type of access client . For example, serve
The service of the client interface can be defined as the external network pool
A small program or HTML5 The business of the page can be defined as H5 pool
The business of other internal departments can be defined as intranet pool .
summary
The system that has not been split is not scalable , But simple , No matter what development 、 Operation and maintenance don't need much energy . After break up , Requirements development needs to span multiple systems and teams , Troubleshooting also involves multiple systems , Each subsystem of operation and maintenance shall be in the charge of a specially assigned person , Therefore, the recruitment of large factories also requires strong communication and cooperation ability .
Expansibility analysis of collection subsystem :
1. Split the main table into four sub tables corresponding to the dimension according to the business dimension
advantage :
This also isolates faults , If a library hangs, it will not affect other DB.
shortcoming :
Large amount of code changes
边栏推荐
- 2022 coming of age ceremony, to every college entrance examination student
- 【图像分割】基于马尔可夫随机场实现图像分割附matlab代码
- Niuke brush questions part8
- Flask CKEditor 富文本编译器实现文章的图片上传以及回显,解决路径出错的问题
- New project construction environment method
- 疫情下远程办公沟通心得|社区征文
- cf:D. Black and White Stripe【连续k个中最少的个数 + 滑动窗口】
- Niu Ke's question -- finding the least common multiple
- I don't want to open an account online. Is it safe to open an account online?
- 美国通胀率8.6%创41年历史新高!通胀高烧不退?股票、加密市场先跌为敬!
猜你喜欢

*Use of jetpack notes room

Gmail: how do I recall an outgoing message?

The 2023 MBA (Part-time) of Beijing University of Posts and telecommunications has been launched
Téléchargement et téléchargement des fichiers nécessaires au développement
Make a static tank

cf:G. Count the Trains【sortedset + bisect + 模拟维持严格递减序列】

动态爆炸效果

Cf:c. restoring the duration of tasks

Experience of remote office communication under epidemic situation | community essay solicitation

基于华为云图像识别标签实战
随机推荐
【图像分割】基于马尔可夫随机场实现图像分割附matlab代码
【信号去噪】基于非线性滤波器实现语音自适应去噪附matlab代码
WWDC22 开发者需要关注的重点内容
Deploy a go MSSQL API endpoint on SAP kyma
2023年西安交通大学管理学院MPAcc提前批面试网报通知
Do you know that public fields are automatically filled in
Niuke brush questions part7
I don't want to open an account online. Is it safe to open an account online?
Replace the backbone of target detection (take the fast RCNN as an example)
Niuke brush questions part8
SQL注入漏洞学习之一:phpstudy集成环境搭建DVWA靶场
如何在 SAP BTP 上 手动执行 workflow
mysql 联合索引和BTree
【题解】Codeforces Round #798 (Div. 2)
公共字段自动填充,你了解吗
【图像去噪】基于绝对差分中值滤波、加权中值滤波法、改进加权中值滤波实现脉冲噪声图像去噪附matlab代码
In 2023, the MPAcc of School of management of Xi'an Jiaotong University approved the interview online in advance
Web3 Games: exploring and reshaping the game experience
Flink CDC 在大健云仓的实践
The Economist: WTO MC12 restarts the digital economy and becomes the core engine of global economic recovery and growth