当前位置:网站首页>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
边栏推荐
- activemq--可持久化机制之JDBC
- 机器学习 —— Sklearn包中StandardScaler()、transform()、fit()的详细介绍
- Redis-哨兵,主从部署详细篇
- C language and SQL Server database technology
- 数据库操作语言(DML)
- 抽象类和接口的区别(最详细)
- [SCADA case] myscada helps VIB company realize the modernization and upgrading of production line
- Write two channel (stereo) immediately Wav file
- Week小结
- Redis的十大常见应用场景
猜你喜欢

nacos2.1.0集群搭建

uni-app - Refused to display ‘xxx‘ in a frame because an ancestor violates the following Content Sec

How can technologists start their personal brand? Exclusive teaching of top five KOLs

Publish Yum private server using nexus3 (offline intranet)

Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL

Idea hot deployment

『每日一问』简单聊聊JMM/说说对JMM的了解

ActiveMQ -- JDBC Journal of persistent mechanism

Comparison between symmetric encryption and asymmetric encryption

Silicon Valley classroom lesson 15 - Tencent cloud deployment
随机推荐
registration status: 204
Ten thousand words long, one word thoroughly! Finally, someone has made business intelligence (BI) clear
[SCADA case] myscada helps VIB company realize the modernization and upgrading of production line
C language and SQL Server database technology
Jspdf generates PDF files. There is a problem of incomplete files. Files are downloaded in the background, but not in the foreground
『每日一问』简单聊聊JMM/说说对JMM的了解
CentOS changes MySQL database directory
Two Sum
API健康状态自检
ActiveMQ -- kahadb of persistent mechanism
activemq--可持久化机制之AMQ
Do you know these methods of MySQL database optimization?
idea实用tips---如今将pom.xml(红色)改为pom.xml(蓝色)
Notes on in-depth analysis of C language 2
The interviewer asked: how to prevent oversold? There are several ways to achieve it
[common tools] obtain system status information based on psutil and gputil
通过robocopy对文件/夹进行复制
In mysql, update and select are used together
Neural network learning (1) Introduction
How can technologists start their personal brand? Exclusive teaching of top five KOLs