Micro-service Architecture pros and cons

Source: Internet
Author: User
Tags live chat

With the idea of devops, continuous delivery, and so on, the micro-service architecture is beginning to come into our vision.

So is microservices the industry's long-awaited solution? Or is microservices simpler than the overall solution?

Let's define the MicroServices first:

MicroServices are built with a small set of services that operate independently in different processes, interacting between services through a lightweight communication mechanism, such as a restful interface, and the services can be deployed independently through an automated deployment approach. Because services are independent of each other in the MicroServices architecture, different services can be developed in different languages or use different types of databases depending on the needs of the business.

James Lewis and Martin Fowler from ThoughtWorks share their understanding of and views of the microservices architecture. In this article, the author introduces the characteristics of microservices and the advantages of microservices architectures compared with traditional architectures.

Some of the advantages of microservices are obvious:

  1. Simple service, focus on only one business function
    In the view of James, the traditional architecture of the overall style has great limitations in building deployment and scaling, and its service-side applications are like a piece of iron, bulky and non-detachable, and any program changes in the system require the entire application to be rebuilt and deployed in the new version. Horizontal scaling can only be extended by the entire system, not a single function module.
    While the MicroServices architecture decomposes the system into multiple services in a modular manner, the service is relatively independent and loosely coupled, and a single function change requires only a rebuild of the corresponding service.

  2. Each micro-service can be developed by different teams
    Traditional development patterns in the division of labor are often technical units, such as the UI team, server team and database team, such a division of labor may lead to any functional changes need to cross-team communication and coordination. While microservices advocate a division of service around services, different services can be implemented using different technologies, and a team should include all the skills needed for development, such as user experience, database, project management.

  3. Micro-services are loosely coupled
    The microservices architecture discards the complex business rules orchestration, message routing and other functions of the ESB, the service in the MicroServices architecture is high cohesion, each service handles the corresponding business, all the business logic should be handled within the service as much as possible, and the communication between the services is as lightweight, as in the use of restful way.

  4. Available in different programming languages and tool development
    Traditional software development often uses the same technology platform to solve all the problems, and experience shows that using the right tools to do the right thing can make development more effective. The microservices architecture inherently has this feature, and we can use node. js to develop a simple report page that uses C + + to write a live chat component.

The introduction of microservices architectures makes it possible to diversify and persist data, and persistent tiers can use traditional relational databases and NoSQL. Unlike traditional applications, the MicroServices architecture allows us to select a new database system for each service that fits the business logic, such as MongoDB, PostgreSQL. The benefit of this is obvious, first of all, we can decide which type of database to use based on the type of business (read more or write more), and then we can reduce the load of a single database. James ' article was widely debated in the community, Contino's CTO Benjamin Wootton wrote that microservices were not as good as they thought, and suggested that developers should be cautious when choosing this architecture. Benjamin that the microservices architecture may face some of the following challenges:

  1. Operation and maintenance overhead
    More services means more operations, the product team needs to ensure that all the relevant services have a sound monitoring infrastructure, traditional architecture developers only need to ensure that an application is working properly, but now it is necessary to ensure that dozens of or even hundreds of processes efficient operation, this is a difficult task.

  2. DevOps Requirements
    With the microservices architecture, the development team needs to ensure that a tomcat cluster is available and that a database is available, which means that the team needs high-quality devops and automation technology. And now, this kind of full-stack talent is very few.

  3. Implicitly-Interface
    Services and services are "contacted" through interfaces, and when a service changes the interface format, all services that may involve this interface need to be adjusted.

  4. Repetitive Labor
    The same functionality may be used in many services, and this function point is not large enough to provide a service level, this time perhaps different service teams will develop this function alone, repetitive business logic, which violates the good software engineering many principles.

  5. The complexity of distributed systems
    MicroServices connect different services through rest APIs or messages, which could be just a simple remote procedure call. Distributed systems also mean that developers need to consider network latency, fault tolerance, message serialization, unreliable networks, asynchrony, versioning, load, and so on, while faced with so many microservices need to be distributed, the entire product needs to have a complete set of mechanisms to ensure that each service can function properly.

  6. transactional, asynchronous, test-facing challenges
    Cross-process transactions, large amounts of asynchronous processing, and overall testing across multiple microservices require a complete set of solutions, and now it seems that these technologies are not mature.

All in all, the microservices architecture has a lot of attractions, but before embracing microservices, recognize the challenges it poses. Each architecture has its pros and cons, and we need to choose the right architecture based on the project business and team situation.


For more information, please follow the public number: It_haha

This article is from the "djh01" blog, make sure to keep this source http://djh01.blog.51cto.com/10177066/1827618

Micro-service Architecture pros and cons

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.