[Understanding] study concluded Micro Services

Reference links:

table of Contents

Pain points of traditional architecture of the monomer

  • Traditional MVC architecture, all service sub-modules are integrated in a JVM process heavy in
    - (MVC: a design pattern, Model-View-Controller (Model - View - Controller) mode This mode is used for applications. tiered development.)
  • Benefits monomer architecture is easy to manage, all the code in the same project.

    Disadvantages:

  • One drawback: the project is too bloated.

    • When large and small, functional blocks are concentrated in the same time to the project, the entire project is bound to become bloated, so developers are difficult to maintain.
  • Shortcoming II: Resources can not be isolated.

    • Like just a small gray experience, the entire monomer system's various functional modules are dependent on the same database, memory and other resources, once a function module improper use of resources, the entire system will collapse.
  • Three shortcomings: not flexible expansion.

    • When the traffic system is getting bigger, of course monomer system can scale horizontally, deployed in a cluster composed of multiple machines. However, this expansion is not flexible expansion. For example, we are now the bottleneck is payment module only want to do the horizontal extension for payment module, which is in monomer system can not do.

Single architecture to address the pain points

  • Bloated monomer system split into fine services.

Micro Services

  • Micro Services (Microservice Architecture) is an architecture popular in recent years ideas

    • Micro-service architecture style is a single application as a set of small service development methods, each application runs in its own process, and communicate with the lightweight mechanism (usually HTTP resource API). These services are built around business functions, and can be deployed independently by automatic deployment mechanism. Minimum centralized management of these services, can be written in different programming languages ​​and use different data storage technologies.
  • Micro-service features:

    • 1. The independent deployment, flexible expansion

      • Traditional architecture is based on the entire monomer system deployed as a unit, while the micro-service is based on each individual components (such as user services, goods and services) to deploy units.
      • For example, according to the throughput of each of the different services, payment services need to deploy 20 machines, customer service need to deploy 30 machines, while goods and services only need to deploy 10 machines. This flexible deployment only micro-service architecture can be achieved.
      • But in recent years popular Docker, provides an effective container for the micro-services architecture.
  • 2. The effective isolation of resources

    • One of the principles of micro-services design, each micro service is independent of the data source, if you want to read and write micro-micro-service A service database B, the service can only be called micro-B exposure to the external interface to complete. This effectively avoids the problem of contention between the service and the database cache resources brings.
    • Meanwhile, since each service instance running on micro Docker containers, to achieve efficient isolation server resources (memory, CPU resources, etc.).
  • 3. The team's organizational structure adjustment

    • Micro-service design thinking also changed the original R & D team organization. Traditional R & D organization is the level of architecture, the front end of the front end team, the rear end of the rear end of the team, have DBA DBA team test with a test team.
    • The design concept of micro-services division team has a certain influence, making the division the team's organizational structure more inclined to vertical architecture, such as user business is a team responsible for payment services is a team to be responsible.
    • Of course, this is just an ideal vertical division of architecture in the enterprise is not the actual organizational structure will split the team was so absolute.

The difference between micro-services and service-oriented architecture (SOA) of

  • SOA architecture is emphasized that reconciliation coupled communication between heterogeneous systems, and micro-services architecture is emphasized that the system do fine-grained boundary split by business and deployment

Frameworks, components, and architecture ideas

  • Dubbo, Spring Cloud is a framework and components, while SOA is architecture and micro-service idea, the concept is not the same level.

  • It can be said Dubbo and Spring Cloud well supported and micro Services Architecture SOA, but SOA can not be said that Dubbo, Spring Cloud micro service.

Lack of micro-services architecture

  • 1, micro service to split the original project into multiple independent project, increases the complexity of development and testing.

  • 2, micro-service architecture need to ensure data consistency between the different services, the introduction of asynchronous distributed transactions and compensation mechanisms, bring some challenges for design and development.

  • So: architecture there is no absolute good or bad, the key scenarios.

END

Guess you like

Origin www.cnblogs.com/anliux/p/11409240.html