The philosophical aspect:: Distributed Systems (c) micro-architecture services in Taiwan

Previous mentioned monomer applications and micro-service architecture, an architecture diagram in spring official website, the gateway also shows this stuff. In this article, we have to understand the next API Gateway, and as a prelude to explore some aspects of micro and service station architecture.

After the split of the service, our system might become like this:

Still looked pretty messy, so the call chain tracking service is very important. For the client, this is hard on the client, the root of so many line calls. Then apply to the middle tier thinking on one of our systems might become like this:

The complexity of all calls to the octagonal orange.

At this time, for the client, if orange octagon is a whole system, the client provides all the functionality, is an all requests inlet.

For internal service, the orange octagon is equivalent to the client to invoke various services. In this case, the system structure can be simplified to:

Orange octagon is the API Gateway, the client through the HTTP protocol gateway and interaction. RPC or HTTP gateway to other ways to interact with content and services. Gateway understand here in the literal sense is this:

  • Pass network: external gateway as internal services, like acts checkpoints. Since it is level, then what can offer?
    • Security check
    • Limiting
    • Route Forwarding
    • polymerization
    • In fact these scenes and life can pass correspondence
  • Network protocol conversion intermediate layer: In addition to the API gateway here, in fact, might have heard things gateways. They have played a protocol conversion function, the figure is to convert the HTTP protocol to a specific RPC protocol

A brief review of Dir-mentioned non-state registry service division under vertical load balancing services can actually go inside realized by the registry, of course, can be achieved using load balancing component. Then the API Gateway for it?

Since the API gateway and the client is interactive, using a registry way is not so easy. That will naturally need to be implemented with load balancing component, as shown below:

Added load balancing and other measures adopted by the previous level, to achieve high availability API gateway itself. Of course load balancing layer can be very complicated, to say the back.


Since the API Gateway load balancing is achieved, then the load balancing service inside of it? If you use the registry to achieve, then the service provider may as shown below:

A1, A2, A3 provide the same service, then the "client" Which should call it? If all calls A3, so no help load balancing purposes. At this time, the load balancing algorithm can be "client", this client can be a gateway or other internal services. In order to protect the business of non-invasive, natural to use agentthis agent model to achieve a soft client load balancing.

In fact, all aspects mentioned above, is composed of micro-services system. Let's look at Figure spring official website:

  • API Gateway: API Gateway
  • Service Registry: Registry Service
  • Microservices: Micro Application Services
  • Distributed tracing: call chain track
  • Config server: Configuration Center. In practice and service center similar, but more inclined to store configuration information type, after all, professional people to do professional things

Just look at these components, in fact very difficult to understand the micro-services. Micro inseparable from the service business scenario, we would not speak.

Service application designed on an analogy may be referred to as object-oriented programming, so good our object design, interaction between objects is also handled well, it is not to complete it?

Of course not, again recalled hierarchical thinking, some objects belong to the same common, some objects that may change, the so-called separation changing and unchanging -

With split then precipitate eventually formed the following structure:

among them:

  • Physical Resources: refers to the cloud service resources, or physical server resources, etc.
  • K8S platform: Previous also briefly mentioned before, the equivalent of basic micro-services software "hardware" facilities
  • Middleware services: for example, mysql, redis, mq series of middleware, a technical platform
  • Basic business services: for example, some common operations, such as push services, etc.
  • Specific business platform: the front desk is the face of a different (web, etc.) applications, the development of specific business service
  • Reception Business: Nature is the WEB, APP and other front-end applications

In this hierarchical division, "object" positioned between layers of clear split inside the layer objects are also clear. Then relatively easy to achieve low coupling, high cohesion, but also to achieve a maximum reuse some extent.

So, in this architecture, micro-services is: a whole from K8S platform - specific business platform. K8S which belong to the micro-service "hardware support" and the remaining part belongs to the micro-service software, but the software can be divided into sections:

  • Basic software support
  • Foundation business support
  • Specific business service

Due to specific business services and reception services are linked closely together, so it can be summed up to the front desk there. The basic software support and infrastructure support business can be called 中台, it is in the final stage for the upper specific business services, and can be called 业务中台.

So back then? Of course, part of the background refers to the various management systems, another portion of the platform can also K8S, physical resources as the background, this is because the underlying layer scheduling, maintenance, and so a variety of monitoring needs.

With this layered architecture, 中台the concept into to our vision. Business desk provides the ability to reuse the upper layer service, making our front office can quickly develop faster, but also the function easier to maintain. So the stage is a further evolution of the micro-service software level.


By three articles, we watched it again the current overall architectural concept, considered at the macro to do a little work guidelines.
Software architecture or system architecture is the aspect of philosophy.

We, see next. Part II began, formally enter the interior of distributed systems, distributed appreciate the vastness of the universe began.

Published 52 original articles · won praise 104 · views 120 000 +

Guess you like

Origin blog.csdn.net/zhou307/article/details/105150722