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

Advantages and disadvantages of micro-service architecture

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

Share

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

With the concept of DevOps, continuous delivery and other concepts deeply rooted in the hearts of the people, micro-service architecture began to enter our field of vision.

So is microservice a long-awaited solution in the industry? Or is micro-service simpler than the overall solution?

Let's first define microservices:

Micro-service is to build an application in the way of a group of small services, services run independently in different processes, services interact with each other through lightweight communication mechanisms (such as RESTful interface), and services can be deployed independently through automated deployment. Because in the microservice architecture, services are independent of each other, different services can be developed in different languages, or different types of databases can be used according to the needs of the business.

James Lewis and Martin Fowler from ThoughtWorks shared their understanding and views on the microservices architecture. In this paper, the author introduces in detail the characteristics of micro-service and its advantages over the traditional micro-service architecture.

Some of the advantages of microservices are obvious:

The service is simple and only focuses on one business function.

In James's view, the traditional overall style architecture has great limitations in building deployment and expansion. Its server application is like an iron plate, bulky and inseparable, and any program change in the system requires the whole application to reconstruct and deploy a new version. In the horizontal expansion, it can only be extended as a whole system, but not for a certain functional module.

On the other hand, the micro-service architecture decomposes the system into multiple services in a component way, and the services are relatively independent and loosely coupled. The change of a single function only needs to rebuild and deploy the corresponding services.

Each microservice can be developed by a different team

Traditional development models often take technology as the unit of division of labor, such as UI team, server team and database team. This division of labor may lead to any functional change that requires cross-team communication and coordination. While micro-services advocate division of labor around services, different services can be implemented with different technologies, and a team should include all the skills needed for development, such as user experience, database, and project management.

Micro services are loosely coupled

Micro-service architecture abandons ESB's complex business rule choreography, message routing and other functions. In micro-service architecture, services are highly cohesive, and each service will handle the corresponding business. All business logic should be handled within services as far as possible, and the communication between services should be as lightweight as possible, such as using Restful.

Can be developed in different programming languages and tools

Traditional software development often uses the same technology platform to solve all problems, and experience shows that using the right tool to do the right thing will make the development get twice the result with half the effort. The microservice architecture is born with this feature. We can use Node.js to develop a simple report page and C++ to write a real-time chat component.

The introduction of micro-service architecture makes it possible to diversify persistent data, and the persistence layer can use traditional relational databases and NoSQL. Different from traditional applications, in the micro-service architecture, we can choose a new database system suitable for business logic for each service, such as MongoDB, PostgreSQL. The benefits of this are obvious. First, we can decide which type of database to use according to the type of business (read more or write more, etc.), and secondly, it can reduce the load on a single database. James's article caused a lot of discussion in the community. Contino's CTO Benjamin Wootton wrote that microservices are not as good as they thought, and advised developers to be careful when choosing this architecture. Benjamin believes that microservices architecture may face the following challenges:

Operation and maintenance cost

More services means more operation and maintenance. Product teams need to ensure that all related services have sound monitoring and other infrastructure. Traditional architecture developers only need to ensure the normal operation of an application. But now it is an arduous task to ensure the efficient operation of dozens or even hundreds of processes.

DevOps requirements

After using the micro-service architecture, the development team needs to ensure that a Tomcat cluster is available and a database is available, which means that the team needs high-quality DevOps and automation technology. Now, there are very few such full-stack talents.

Implicit interface

Services and services are "connected" through interfaces, and when a service changes the format of the interface, all services involved in this interface may need to be adjusted.

Repetitive work

The same function may be used in many services, but this function point is not large enough to provide a service. At this time, different service teams may develop this function separately, repetitive business logic. This violates many principles of good software engineering.

Complexity of distributed system

Microservices connect different services through REST API or messages, which may have been a simple remote procedure call before. Distributed system means that developers need to consider network delay, fault tolerance, message serialization, unreliable network, asynchronism, version control, load and so on. When so many micro-services need to be distributed, the whole product needs a complete set of mechanisms to ensure the normal operation of each service.

Transaction, async, and testing face challenges

Cross-process transactions, a large number of asynchronous processing, and overall testing between multiple microservices all require a complete set of solutions, and now it seems that these technologies are not mature.

All in all, the micro-service architecture has many attractions, but recognize the challenges it poses before embracing it. Each architecture has its own advantages and disadvantages, and we need to choose the appropriate architecture according to the project business and team situation.

For more information, please follow the official account of Wechat: it_

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

Database

Wechat

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

12
Report