当前位置:网站首页>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
边栏推荐
- c语言中的六个存储类型:auto register static extern const volatile
- activemq--异步投递
- nacos2.1.0集群搭建
- ActiveMQ -- persistent mechanism
- 神经网络方法——美国波士顿房价(回归问题)
- 『每日一问』LockSupport怎么实现线程等待、唤醒
- Jspdf generates PDF files. There is a problem of incomplete files. Files are downloaded in the background, but not in the foreground
- 实现简单的RESTful API服务器
- What is the difference between mongodb and redis
- activemq--死信队列
猜你喜欢

Ten thousand words long, one word thoroughly! Finally, someone has made business intelligence (BI) clear
![[GYCTF2020]Node Game](/img/8d/7e6c2fb2a0359298fbcc1cd8544710.png)
[GYCTF2020]Node Game

API健康状态自检

『每日一问』LockSupport怎么实现线程等待、唤醒

mysql中的数据结果排名

分布式一致性协议之Raft

Wechat applet obtains the data of ---- onenet and controls the on-board LED of STM32

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

TCP网络应用程序开发流程

Network principle (2) -- network development
随机推荐
[GYCTF2020]Ez_Express
activemq--死信队列
Unable to start debugging on the web server, the web server failed to find the requested resource
Front page printing
神经网络方法——美国波士顿房价(回归问题)
CentOS changes MySQL database directory
Reverse Integer
[common tools] obtain system status information based on psutil and gputil
OverTheWire-Bandit
『怎么用』装饰者模式
MySQL appends a string to the string of a field in the table [easy to understand]
SSM高级整合
c语言中的六个存储类型:auto register static extern const volatile
Go基础4
[BUUCTF-n1book][第二章 web进阶]SSRF Training
ActiveMQ -- kahadb of persistent mechanism
Shell脚本
深入理解static关键字
Notes on in-depth analysis of C language 2
在Ubuntu中安装MySQL并创建新用户