当前位置:网站首页>What are stand-alone, cluster and distributed?
What are stand-alone, cluster and distributed?
2022-07-25 09:25:00 【Work hard, work hard, gzc】
First, a vivid picture :

Stand alone structure
I think you are most familiar with the single machine structure , When the business volume of a system is very small, all the code should be put in one project , Then the project is deployed on a server . All services of the whole project are provided by this server . This is the stand-alone structure . that , What are the disadvantages of single machine structure ? Obvious , After all, the processing power of a single machine is limited , When your business grows to a certain extent , The hardware resources of a single machine simply cannot meet your business growth needs . At this point, the cluster mode appears , So let's look down .
Cluster structure
There are various kinds of forced explanations for cluster mode in the world of programming apes , Some of them are beyond your comprehension , It's actually a very simple thing , Just listen to me .
When the stand-alone processing reaches the bottleneck , You just make a few copies of the single machine , This constitutes a “ colony ”. Each server in the cluster is called one of the cluster “ node ”, All nodes form a cluster . Each node provides the same service , In this way, the processing power of the system can be increased several times ( There are several nodes that are up to so many times ).
But the question is which node will handle the user's request ? It is better to be able to let the node with smaller load handle at this moment , This makes the pressure at each node average . To implement this function , You need to add one... Before all the nodes “ Dispatcher ” Role , All requests from the user are given to it first , Then it depends on the current load of all nodes , Decide which node will handle the request . This “ Dispatcher ” There's a cow named —— Load balancing server .
The advantage of cluster structure is that system expansion is very easy . If with the development of your system business , The current system can't support , Then add more nodes to the cluster . however , When your business develops to a certain extent , You will find a problem —— No matter how you add nodes , It seems that the performance improvement effect of the whole cluster is not obvious . Now , You need to use the microservice structure .
Distributed structure
Let's make a summary of the previous knowledge points .
From stand-alone structure to cluster structure , Your code basically doesn't need to be modified , All you have to do is deploy more servers , Just run the same code on each server . however , When you want to evolve from a cluster structure to a microservice structure , The previous code needs to be changed a lot . So for the new system, we suggest , At the beginning of system design, micro service architecture was adopted , In this way, the cost of later operation and maintenance is lower . But if an old system needs to be upgraded to a microservice structure , Then we have to fight the code . therefore , For the old system , Keep cluster mode on earth , Or upgrade to microservice architecture , This requires careful consideration by your architect 、 Weigh the input-output ratio .
OK, Let's start with the so-called distributed structure .
Distributed architecture is a complete system , According to the business function , Split into independent subsystems , In a distributed architecture , Each subsystem is called “ service ”. These subsystems can run independently in web In the container , They pass through RPC Means of communication . for instance , Suppose you need to develop an online mall . According to the idea of microservice , We need to split it into multiple independent services according to functional modules , Such as : Customer service 、 Product service 、 Order service 、 Background management services 、 Data analysis services and so on . These services are independent projects , Can run independently . If there is a dependency between services , Then through the RPC Way to call .
There are many advantages of this :
The coupling between systems is greatly reduced , It can be developed independently 、 Independent deployment 、 Independent testing , The boundary between the system and the system is very clear , It's also quite easy to make mistakes , Development efficiency is greatly improved .
The coupling between systems is reduced , So the system is easier to expand . We can extend some services specifically . Let's say that the mall will make a big promotion , Orders may be greatly increased , So we can improve the order system 、 Number of nodes in the product system , And for the back office management system 、 Data analysis system , Keep the number of nodes at the original level .
Services are more reusable . such as , When we use the user system as a separate service , All products of the company can use the system as a user system , No need for redevelopment .
Reprint zizhihu user Big idle man, Chai Maomao
边栏推荐
- Analysis of concat and group in MySQL_ Use of concat
- Nacos启动报错Unable to start web server
- sqli-labs Basic Challenges Less11-22
- Shell脚本
- ActiveMQ -- leveldb of persistence mechanism
- idea实用tips---如今将pom.xml(红色)改为pom.xml(蓝色)
- redis操作利用游标代替keys
- Silicon Valley classroom lesson 15 - Tencent cloud deployment
- 分享一个避免递归的部门设计方法
- Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
猜你喜欢
随机推荐
分布式一致性协议之Raft
redis的五种数据结构原理分析
将list集合的某一字段拼接单个String
activemq--消息重试机制
activemq--可持久化机制之JDBC
OmniPeek packet capturing tool
activemq--可持久化机制之AMQ
Comparison between symmetric encryption and asymmetric encryption
Unable to start debugging on the web server, the web server failed to find the requested resource
C#语言和SQL Server数据库技术
通过robocopy对文件/夹进行复制
activemq--死信队列
jsPDF生成PDF文件,文件不全问题,后台进行文件下载,前台不下载
深入理解static关键字
Do you know these methods of MySQL database optimization?
数据库操作语言(DML)
Composition of the interview must ask items
In mysql, update and select are used together
Kubedm introduction
『怎么用』装饰者模式








