Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the advantages and disadvantages of microservices?

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what are the advantages and disadvantages of micro-service". Interested friends might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the advantages and disadvantages of micro-services?"

I. what is a microservice?

When introducing micro-services, we must first understand what micro-services are. As the name implies, micro-services have to be understood from two aspects: what is "micro" and what is "service". Micro, in a narrow sense, is a small, famous "2 pizza team" that well explains this explanation (2 pizza team was first put forward by Amazon CEO Bezos, which means that the design of a single service requires only 2 pizzas for all participants from design, development, testing, operation and maintenance). The so-called service must be different from the system, service an or a group of relatively small and independent functional units, is the minimum set of functions that users can perceive.

Microservices were first proposed by Martin Fowler and James Lewis in 2014. the microservice architecture style is a way to develop a single application using a set of small services, each running in its own process and communicating using lightweight mechanisms, usually HTTP API. These services are built on business capabilities and can be deployed independently through automated deployment mechanisms, and these services are implemented in different programming languages And different data storage technologies, and maintain a minimum of centralized management.

Second, the advantages of micro-services:

1. Each microservice is small so that it can focus on a specified business function or business requirement.

two。 Microservices can be developed separately by a small team of two to five developers.

3. Microservices are loosely coupled and functionally meaningful, and are independent in either the development phase or the deployment phase.

4. Microservices can be developed in different languages.

5. Microservices are easy for a developer to understand, modify, and maintain, so that small teams can pay more attention to their work. There is no need for cooperation to realize value.

6. Microservices allow you to take advantage of the latest technologies.

7. Microservices are just code for business logic and will not be mixed with HTML,CSS or other interface components.

III. Shortcomings of micro-service architecture

1. The requirements of operation and maintenance are higher. For a single architecture, we only need to maintain this project, but for a micro-service architecture, because the project is made up of multiple micro-services, problems with each module will cause abnormal operation of the whole project. It is often not easy to know which module is causing the problem, because we cannot track it step by step through debug. This puts forward high requirements for operation and maintenance personnel.

two。 Distributed complexity. For single architecture, we do not have to use distribution, but for micro-service architecture, distribution is almost a necessary technology. Because of the complexity of distribution itself, micro-service architecture becomes more complex.

3. The cost of interface adjustment is high. For example, the user micro-service is called by the order micro-service and the movie micro-service. Once the interface of the user's micro-service changes greatly, then all the micro-services that depend on it have to be adjusted accordingly. Because there may be a lot of micro-services, then the cost of adjusting the interface will be significantly increased.

4. For a single architecture, if a business is used by multiple modules, we can abstract into a tool class, which can be called directly by all modules, but micro-services cannot do so. Because this tool class of micro-services cannot be directly invoked by other micro-services, we have to build such a tool class on each micro-service, which leads to code duplication.

At this point, I believe you have a deeper understanding of "what are the advantages and disadvantages of micro-services". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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: 0

*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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report