The official definition of

Microservices are a set of small services developed around their own business, independently deployed and running in their own processes, based on distributed management

Easy to define

Microservices are an architecture that separates a single overall application into smaller, project-related independent services. A service typically implements a separate set of features or functions, including its own business logic and adapters. The correlation between microservices is achieved by exposing apis. These independent microservices do not need to be deployed on the same VIRTUAL machine, system, or application server.

Single application

  • Advantages:

    • The single architecture pattern is easy to develop, easy to test, easy to deploy and works well at a very early stage of the project.
  • Disadvantages:

    • Applications add more and more functionality over time, and eventually become huge, with a project likely to have millions of lines of code and cumbersome JARS stacked against each other.
    • Over time, the development efficiency is low and the code maintenance is difficult.
    • Another is that if you want to use a new technology, a new framework or a new language, it’s impossible.
    • Any module vulnerability or error will affect the application and reduce the reliability of the system.

Microservices architecture applications

  • advantages
    • Services are separated into smaller services with a single responsibility, deployed separately, and communicate with each other over a network.
    • Each service should have its own separate management team with a high degree of autonomy.
    • Services have their own separate responsibilities and are loosely coupled to avoid service breakdown due to a module failure.
  • disadvantages
    • Developers deal with the complexity of distributed systems.
    • Multi-service o&M is difficult. With the increase of services, the pressure of O&M also increases
    • Service governanceandService monitoringExtremely complex and critical.

The evolution of the architecture

Single application architecture —-> Vertical application architecture —-> Distributed Services Architecture —-> Elastic Computing Architecture (Microservices Architecture)

  1. Single Application architecture —- All in One Application

    At first, when the website traffic is very small, all the functions are written in one application, and the whole application is deployed to reduce the deployment nodes and costs. ORM, a data access framework that simplifies the work of adding, deleting, modifying and reviewing data, is key to this architecture.

  2. Vertical Application architecture —- Vertical Application

    As traffic increases, the acceleration caused by a single application increases less and less. One way to improve efficiency is to break the application into several unrelated applications to improve efficiency. At this point, MVC, a Web framework for accelerating front-end page development, is key.

  3. Distributed Service architecture —- Distributed Service

    With the increasing number of vertical applications, the interaction between applications is inevitable. Core businesses are extracted as independent services, gradually forming a stable service center, so that front-end applications can respond to changing market demands more quickly. At this point, RPC, a distributed service framework for improving service reuse and integration, is the key.

  4. —- Elastic Computing (Microservices Architecture

    As the number of services increases, problems such as capacity evaluation and waste of small service resources gradually emerge. In this case, a scheduling center needs to be added to manage cluster capacity in real time based on access pressure to improve cluster utilization. At this point, SOA, the resource scheduling and governance center for improving machine utilization, is key.

    Note: good architecture is not designed, it must be evolved!!

Microservices solutions

1. Dubbo

At the end of 2011, Alibaba opened the Java-based distributed service governance framework Dubbo on GitHub. Since then, it has become the leader of such open source projects in China, and many developers like it. At the same time, many companies have implemented distributed system architecture based on Dubbo in practice. At present, the number of its fork and star on GitHub has exceeded 10,000. Dubbo is committed to providing high-performance and transparent RPC remote service invocation solutions and SOA service governance solutions, enabling applications to seamlessly integrate the output and input functions of services with the Spring framework through high-performance RPC. Dubbo consists of three core parts: remote communication, cluster fault tolerance and automatic discovery.

Due to RPC protocol, registry metadata mismatch and other issues, Dubbo and Spring Cloud are the only two choices when it comes to microservices infrastructure selection, which is one of the reasons why people always compare Dubbo and Spring Cloud. Dubbo will then actively seek to adapt to the Spring Cloud ecosystem, such as leveraging Dubbo’s performance benefits as a binary communication solution for Spring Cloud, or adapting Dubbo to Spring Cloud through modularity and SUPPORT for HTTP.

2. Spring Cloud

  1. Spring Cloud NetFlix

    Based on the open source components of Netflix, it provides a stack of micro services solution.

  2. Spring Cloud Alibaba

    Alibaba’s micro-service solution is encapsulated on the basis of Spring Cloud Netflix.

  3. Spring Cloud

    Spring’s official trend is to take the best of Netflix components and build on them with secondary packaging to create a spring-specific solution.