In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you what is the difference between single service, cluster and distribution. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1. Distributed introduction 1. Architecture introduction
In today's Internet, almost all common complex systems use distributed architectures. if you just come into contact with the term distributed architecture before you are not clear about the concept, you will feel very high-end. In fact, after comparing single services and cluster services, you will find that it is essentially the same.
The so-called Java architect basically looks at the frequency of sheet services, clusters, and distributed beatings. Because of the high frequency of abuse, architects naturally produce fewer system architecture pits, and novices can't do architecture, so you should understand.
Back to the point, distributed architecture is basically a watershed for Java development. Whether you can jump out of the development level depends on how much you understand distributed systems after working for three or five years. Single-service applications are based on single-service cluster deployment. This kind of operation and maintenance can build the environment on their own, so the basic requirements for capabilities are not high. However, it is indeed a challenge to design a flexible, configurable, distributed, high-performance, high fault-tolerant and secure distributed system.
2. Clustering and distribution
First of all, we need to clarify the differences between single service, cluster, and distributed architectures.
Single service and cluster
A picture, your taste, your fine taste:
The volume of business is small, and all services and applications are deployed on one service, which saves costs. This is a single service structure. When the business volume increases gradually, expand a service horizontally and make a service group, each service is called a node of the cluster, and this is the cluster service. One of the problems that cluster services face is that request allocation naturally requires a scheduling component to balance server pressure, which is also known as load balancing.
In fact, the essential difference between a single service and a cluster is that there is an extra process of allocating services when dealing with requests. Do you still think it is very high-end to brag about clusters with others?
Distributed system
A picture, your taste, your fine taste:
This concept is not easy to explain, single service to cluster, is a change in deployment, minimal changes at the code level, the cluster mode will add more service monitoring, in order to quickly determine which service is down.
First of all, I would like to explain the above picture: common e-commerce system architecture (part of the business), orders, warehousing, logistics.
When users place an order in the order service, they naturally need to check the inventory.
After placing the order successfully, you need to track the order logistics.
Merchants need warehousing services to manage goods on shelves, shipments, etc.
If the order service has high concurrency, it can be expanded horizontally to cluster the order service.
This is a basic business scenario with the characteristics of multi-application services, multi-database storage, and communication between services, which can be horizontally expanded and clustered when individual services are under great pressure.
According to the function of the business system, the distributed structure is divided into independent sub-services, which can run independently, and the services communicate and interact with each other. The benefits are also very many, such as: reducing the coupling between businesses, convenient development and maintenance, horizontal expansion, high reusability and so on.
One sentence of supplement: do not have the illusion that the boundary of a distributed system is larger than that of a cluster. If you regard a distributed system as a whole as a service and make cluster deployment for this distributed service, it is logically reasonable. It's just that it violates the original intention of the distributed system, such as background services, which does not have so much high concurrency and naturally does not waste resources.
3. A summary
The root cause of distributed and cluster models is to solve two problems: improving system throughput and high availability, but the two modes stand from different perspectives and business scenarios, such as monotonous high concurrency scenarios, complex business scenarios without concurrency, of course, there are both these two business scenarios.
In a word of supplement: for system architecture and selection, the major companies do not have a unified standard, but all emphasize the specification and logic of writing code, and the fundamental reason for doing so is to facilitate subsequent system architecture changes.
Second, distributed technology stack
After talking about the basic concepts above, let's talk about the technical architecture in the distributed system. The topic is still a little elegant. Distributed is a kind of architectural thinking and pattern, it is not necessary to use a specific framework, now several popular frameworks, SpringCloud,Dubbo,AliCloud and so on, the emergence of these are to provide more choices for the architecture.
A supplementary sentence: the architecture system and framework must be separated from the concept, and the framework is more convenient for the rapid landing and implementation of the architecture.
1. Service architecture
As a developer, distributed systems have a lot of problems to deal with, but the mainstream modules are as follows:
Gateway control
The gateway mainly involves request verification, aggregation API, routing configuration, authentication management, security, grayscale publishing and so on. Common Zuul components.
Configuration center
Dynamic resource configuration loading, such as runtime traffic management, environment switching, static resource management, etc. Commonly used Nacos and config components.
Service management
The module that is the most difficult to manage in the distributed environment is also the most error-prone. First of all, in the case of multi-service operation, it is necessary to ensure the normal interaction between services, avoid the backlog of requests on a certain service on the link, break in time when there is an exception, and downgrade the service. When high concurrency reaches the peak, it is necessary to configure the current-limiting strategy and the most difficult distributed transactions. Here is also known as service fault-tolerant design, commonly used components such as Eureka, Hystrix, Sentinel, Dubbo and so on.
A supplementary sentence: the real core content of a distributed system, even if a good architect, builds a distributed environment that is constantly optimized in the course of business development and will not remain the same.
2. Containerized operation and maintenance
As an operation and maintenance staff: the deployment of distributed systems is indeed an extremely complicated task, at this time the containerized operation and maintenance was born.
Deployment environment
Some services need to deploy public cloud (cloud services of several large companies), while others need to deploy private cloud (cloud services built by their own companies and only serve their own business). Hybrid cloud requires deployment services in both environments mentioned above. In short, if you don't say so now, you will seem to keep a low profile.
Containerization technology
Package and deploy the service in a Docker container. If you need to expand temporarily, you can quickly deploy the Docker container image to multiple servers. If you are confused about this concept, it is like multiple virtual machines in your computer. You can quickly copy multiple virtual machines based on one virtual machine image file. One of the major features of Docker is: build once, run everywhere.
Here we must sigh that Java has been popular for such a long time for a reason, and many subsequent technologies are based on this basic idea.
Environmental monitoring
The application of distributed system is very complex, so it is necessary to do a very good job of monitoring, not only for service monitoring, but also for hardware environment. Rapid expansion, positioning downtime service.
III. Data storage
This super-large module has not been mentioned above, and it must be clear that the most complex logic of any system is data storage. From the development level, the core value of an architecture lies in data management.
1. Basic description
Based on the above distributed concept, the database is understood in the same way. Distributed database can solve the bottleneck of IO or CPU in a single database storage. The common modes are as follows:
Relational type
The application integrates the middleware of a database agent, routes the data to different database tables based on a specific strategy, and queries the data with the same logic. Very classic sharding-jdbc components, sub-library sub-table mode.
Distributed system
The above relational database sub-database sub-table processing, is relatively explicit and deliberate, in the distributed database, natural support, and has a good horizontal expansion ability. For example: Hbase, mongodb, Greenplum distributed data warehouse and so on.
2. Database selection
Distributed system architecture and distributed data storage complement each other, no matter architecture selection or storage selection, there is no standard that can be suggested. Here can only be described by a very useful nonsense: based on their own technical cognitive scope, and business scenarios.
Thank you for reading! This is the end of the article on "what's the difference between single service, cluster and distribution". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 226
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.