The difference between microservices, distributed and clusters (understand thoroughly)

The difference between microservices, distribution and clustering



Before making the distinction, let’s understand a few concepts.

For interviews, you can directly look at the summary at the bottom for

horizontal breakdown.

Split according to the idea of ​​"layering". For example, a project can be split into the presentation layer (jsp+servlet), business logic layer (service) and data access layer (dao) according to the "three-tier architecture", and then deployed separately: deploy the presentation layer on server A , deploy the service and dao layers on server B, and then integrate server A and server B through dubbo and other RPCs (there are dubbo video courses in the "Read the original text" in the lower left corner, you can click to learn), as shown in the figure shown.

v2-51d2bd9aac06842f39f3a0e2411b2d0b_720w.jpg
split vertically

Split based on business. For example, "e-commerce projects" can be split into "order projects", "user projects" and "flash sale projects" based on business logic. Obviously these three split projects can still be used as independent projects. This method of splitting is called vertical splitting.

v2-571c0559221958b5d63ec7bf557157f1_720w.jpg

microservices



Microservices is a design method for system architecture. It splits complex businesses into multiple tiny services. Each service can be run and deployed independently. Services can communicate with each other using RPC.

Microservices can be understood as a very fine-grained vertical split. For example, the above "order item" is originally a vertically split sub-item, but in fact, the "order item" can be further split into "shopping items", "settlement items" and "after-sales items", as shown in the figure.
v2-5ac8c1aaca336a8e6182e96ccb50b553_720w.webp
The microservice architectural style is like developing a separate application into a set of small services. Each small service runs in its own process and communicates using a lightweight mechanism, usually HTTP API. These services are built around business capabilities. , and are deployed independently through a fully automated deployment mechanism. These services are written in different programming languages, as well as different data storage technologies, and maintain a minimum of centralized management.
In short , large single applications are rejected, services are micro-split based on business boundaries, and each service is deployed and run independently.

distributed



It is a systematic deployment method, which mainly splits the same service into multiple machines that can be deployed.

It refers to distributing different businesses in different places (key point) (for example, JD.com distributes each business on different servers). For example,
the core of the above-mentioned horizontal split distribution is one word: split. As long as a project is split into multiple modules and these modules are deployed separately, it is considered distributed.

cluster



The essence of a cluster is to gather several servers together to achieve the same business (such as a shopping cart, one server is not enough, put ten servers, ten servers can complete the same business)

For example: JD.com is a distributed system. Many businesses run on different machines. All businesses form a large business cluster. For each small business, such as user systems, one server is not enough when access pressure is high. We The user system should be deployed to multiple servers, that is, each business system can also be clustered.
For example: the user enters www.jingdong.com and enters the Jingdong website to complete the entire shopping process. We do not feel how many servers there are behind Jingdong. , because JD.com is a distributed system, and its various businesses run on different machines. These machines combine to complete the functions of the entire JD.com, so these businesses can be called large-scale business clusters.

Every node in the distribution can be a cluster, but the cluster is not necessarily distributed.

Clusters are not necessarily distributed? For example, the user system cluster is not distributed, the entire Jingdong system is distributed

Summarize



From a conceptual understanding, distributed service architecture emphasizes servitization and decentralization of services , while microservices emphasizes service specialization and fine division of labor . From a practical perspective, microservice architecture is usually a distributed service architecture , and vice versa . may not be established. Therefore, choosing microservices usually means solving various problems of distributed architecture.

Differences Between Microservices and Distributed Interview Answers

  • Microservices is a design method for system architecture. It splits complex businesses into multiple tiny services. Each service can be run and deployed independently. Services can communicate with each other using RPC.
  • Distributed is a system deployment method, which mainly splits the same service into multiple machines that can be deployed.
  • The essence of a cluster is to bring several servers together to implement the same business
  • Microservice architecture is a subset of distributed service architecture
  • Distributed deployment is not necessarily a microservice architecture, and microservice applications do not necessarily require distributed deployment.
  • Every node in the distribution can be a cluster, but the cluster is not necessarily distributed.

Guess you like

Origin blog.csdn.net/weixin_44030143/article/details/130160842