Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

First, single-server architecture

Founded early small ape ready to build a power company's Web site selling products, because the company initially small business subscribers and anxious on the line, with limited funds the company purchased a server, a small ape team to develop the site into a server this will be formally launched.

Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

Second, server clusters

Project on the line was soon exposed a lot of problems:

  • Of a single point (the server downtime will cause the entire system unusable)
  • Processing efficiency, the amount requested a single server can receive is very limited, a substantial decline in the case of large user response times, and even memory overflow.

Encountered these problems must be adjusted to the service architecture, we decided to increase the number of servers by small ape team talk, so you can have a single server to solve the problem of excessive pressure request, while the server is down, even if some can also provide services outside normal .

Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

Clusters introduces several new questions:

  • ip address of each server is not the same, how to let users know which one you want to access in the end?
  • session problems before the user login information, shopping cart information, etc. are the existence of the server's memory, how to ensure that each server share session data server cluster.

Third, load balancing

Now need to be addressed so that each server is processing requests can actually balance a number of possible, such as round robin. This is the load balancing .

After the main job is to load balancer accepts a user request, and according to a certain algorithm a request to the different server, forming a structure adjustment mode of FIG.

(Bring the session clustering problem can generally be adopted redis or other cache server for processing, not here to discuss a)

Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

Fourth, the Distributed

With the company's business more and more small ape load, team members are more and more systems slowly become increasingly large, but also brought some problems:

  • Just modified a number of small business features, but need to be re-released once the entire system;
  • Complex business systems, developers too much bad management, low efficiency of development;
  • Unable to expand processing capacity at the server for a particular business

I think of a solution, in accordance with the system module is divided into various subsystems, each team has a corresponding responsibility to complete subsystems call each business function.

Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

Of course the figure will still exist in the framework of a single point , this time can be combined with each other and technology clusters to improve the stability of the architecture

Fifth, micro-services

After the split system is a complete system for each small independent business systems, can have its own separate database, each small system is a micro-services , foreign exposes its own API, through micro-services, it can be very good achieve the expansion, such as when two-eleven activities, orders surge, this time to consider the deployment of more than a few trading systems to cope with the pressure of high strength request, with the increase in the number of systems, we also need to introduce service management tools (such as: Eureka), which it has to manage the health of each service.

Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

Of course, the micro-architecture will also serve to introduce many new problems need to be addressed, such as distributed transaction, call exception handling, permissions, authentication, etc. range of issues, not here on the first extended, and then continue to improve the follow-up supplement.

Written in the last:

I welcome everyone's attention [number of public calm as code ], mass Java-related articles, learning materials will be updated on the inside, finishing materials will be on the inside.

I feel good to write on a point of praise, plus followers chant! Point of attention, do not get lost, continuously updated! ! !

Wen outlined the evolution of a server architecture: clusters - Distributed - Micro Services

Guess you like

Origin blog.51cto.com/14570694/2477472