Distributed registry systemTechnical Field
The invention relates to the technical field of micro-service architecture, in particular to a distributed registry system.
Background
With the development of industry technology, more and more enterprises and institutions are transforming technical architecture, and the micro-serviceization of the system is built.
For large enterprises and institutions, a registry (such as Eureka, zookeeper, nacos) which is relatively popular in the market at present has a certain bottleneck for registering service instances and service continuation, and when the service instances reach a certain amount, the service instances can cause great performance influence on the whole business system, and even cause normal operation of the system.
Disclosure of Invention
The invention aims to provide a distributed registry system which can solve the problem that a registry service instance in a registry has a bottleneck.
In order to solve the above technical problems, the present invention provides a distributed registry system, the system comprising: the client SDK is used for accessing the client system to the distributed registry; the Proxy layer is used for virtually forming N virtual slices on the data node, calculating a hash value according to the service identifier after receiving the request of the client SDK, and routing the hash value to a specific data node; the data persistence layer comprises a plurality of data nodes and is used for carrying out distributed storage on the micro-services and providing registration services according to the received requests; and the management console is used for managing each component of the distributed registry.
In some implementations, the client SDK supports registration and discovery of services, self-discovery and loading of Proxy layers.
In some implementations, the client SDK is compatible with access to multiple registry frameworks simultaneously, where the registry frameworks include: zookeeper, eureka, nacos, and the like.
In some embodiments, the data persistence layer is composed of a plurality of small clusters, each small cluster having data nodes disposed therein.
In some embodiments, the virtual slices are disposed corresponding to small clusters.
In some embodiments, the data node is configured to store a service registration instance.
In some embodiments, the management console primarily manages rights management for the registry.
In some embodiments, black and white lists accessed to the registry are included, proxy on-line management, data node management, virtual sharding maintenance, service routing, weight, and the like.
In some embodiments, further comprising: the data synchronizer is used for being compatible with stock application, and can synchronize service registration instance information of the original stock application into the distributed registration center and synchronize service registration instance of the distributed registration center into the original stock registration center.
With such a design, the invention has at least the following advantages:
through the distributed registry, service access carries out request routing through Proxy, unlimited capacity expansion Proxy according to needs can be supported, and through service identification consistency hash calculation, service information is routed to different data nodes, so that distributed storage of service information is realized, and the requirements of millions of instances of large enterprises and institutions are met.
Drawings
The foregoing is merely an overview of the present invention, and the present invention is further described in detail below with reference to the accompanying drawings and detailed description.
Fig. 1 is a schematic diagram of a distributed registry system according to an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
Because of limited service registration examples supported by registration centers in the market at present, the method has a certain limitation on micro-service construction of large enterprises and institutions, and registration and discovery of millions of examples are realized by developing a distributed registration center.
Referring to fig. 1, the distributed registry design is split into five modules as a whole: client SDK, proxy layer, data persistence layer, management console, and data synchronizer.
The client SDK is mainly responsible for accessing the client system to the distributed registry, supporting the registration and discovery of services, self discovery and loading of Proxy layers, and simultaneously being compatible with the access of the main-stream registry frameworks in the current market, such as zookeeper, eureka and other registries, so that the stock system can be easily accessed to the distributed registry.
The Proxy layer is mainly responsible for the access of clients, the Proxy is in stateless design, can be infinitely expanded to support the access of tens of thousands of services, the Proxy layer logically virtualizes data nodes into N virtual segments, the virtual segments are distributed on a Hash ring through a consistency Hash algorithm, the Proxy receives a client request, calculates Hash according to service identifiers to route to specific data nodes, registration and discovery of the services are achieved, and meanwhile the service registration information quantity of each data node is reduced.
The data persistence layer stores the registered instance of the service, the data persistence layer is composed of a plurality of small clusters, and Proxy routes the small clusters to different data clusters to realize distributed storage.
The management console mainly manages authority management of the registry and comprises management and control functions of black and white lists accessed to the registry, proxy on-line management, data node management, virtual fragment maintenance, service routing, weights and the like.
The data synchronization application is mainly used for being compatible with stock application, can synchronize service registration instance information of the original stock application into the distributed registry, and can synchronize service registration instance of the distributed registry into the original stock registry.
The above description is only of the preferred embodiments of the present invention, and is not intended to limit the invention in any way, and some simple modifications, equivalent variations or modifications can be made by those skilled in the art using the teachings disclosed herein, which fall within the scope of the present invention.