A linear scalability cluster construction system and method
By using a linear scaling cluster to build a system in the Internet system, it is divided into business units and global units, and a high availability mode of one main and multiple backups is formed, which solves the high performance and disaster recovery problems of the Internet system when the business volume increases, and achieves efficient capacity expansion and disaster recovery capabilities.
Patent Information
- Application Number
- CN202111600047.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-12-24
AI Technical Summary
When the business volume of existing Internet systems increases, it is difficult to effectively solve the problems of high performance and disaster recovery, especially when the capacity of a single computer room is insufficient. The vertical and horizontal modes of multiple computer rooms have their own advantages and disadvantages, making it difficult to take into account capacity expansion and disaster recovery capabilities.
The linear scalability cluster is used to build a system. By dividing it into business units and global units according to the data characteristics of the service during deployment, it is divided into logical units and physical units from the deployment architecture, forming a high-availability model of one main and multiple backups to realize central-level disaster recovery, and reducing single database connection bottlenecks and capacity bottlenecks through data splitting in the business dimension.
It has achieved the reduction of load pressure on single-computer room services and databases, reduced the granularity of fault isolation, solved the complexity of capacity estimation and expansion, reduced the cost of failover, and has extremely high linear expansion capabilities.
Smart Images

Figure CN114253732B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet, and in particular to a system and method for building a linear scalability cluster. Background Art
[0002] Any Internet system, as its business volume grows, must consider high performance and disaster recovery issues. With the increase in applications, servers, and databases, when the capacity of a single computer room is insufficient, multiple computer rooms will be chosen for deployment. Currently, there are two common ways to deploy multiple computer rooms: vertical deployment, which divides the entire site application and database into several parts and places them in different computer rooms. To complete a business, different applications in different computer rooms may be required to provide services. This is equivalent to logically enlarging a physical computer room, and the problem of insufficient computer room capacity is solved.
[0003] In horizontal deployment, the applications deployed in each computer room are the same, and each computer room has the ability to complete all services of the entire site. During operation, each computer room only bears a part of the business traffic of the entire site. These two modes have their own advantages and disadvantages. Vertical deployment can break through the bottleneck of computer room capacity, but does not have computer room-level disaster recovery capabilities. Horizontal deployment requires each computer room to store the full amount of production data, and there are problems in traffic allocation and cross-computer room calls that are difficult to implement. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a method and system for building a linear scalability cluster that overcomes the above problems or at least partially solves the above problems.
[0005] According to one aspect of the present invention, a system for building a linear scalability cluster is provided, the system comprising:
[0006] During deployment, services are divided into business units and global units according to their data characteristics.
[0007] From the deployment architecture perspective, it is divided into logical units and physical units.
[0008] Optionally, the business unit is a collection of data that can be split according to business elements, and services for related businesses of the business data;
[0009] The global unit is a collection of global services and data they face that are relied upon by all business units;
[0010] The logical unit includes a set of the physical units facing the same data slice;
[0011] The primary and backup physical units should be distributed in different computer rooms to form a high-availability mode of one primary and multiple backups to achieve center-level disaster recovery.
[0012] Optionally, the construction method includes:
[0013] Plan business data, estimate the data capacity of each business unit, and shard data according to business elements. Different business data shards fall into different business units.
[0014] Related business operations for the same business element are converged into the same business unit;
[0015] When the service is deployed, it is deployed through the deployment center. In the metadata definition of the registration information, the attributes of the logical unit and the physical unit of the service are extended. When the service is registered, the attributes are written into the registration center together.
[0016] When a service request is made, the request traffic carries the service elements;
[0017] Obtain the sharding business elements in the request information, call the global routing system, and determine the target logical unit to be called according to the business elements;
[0018] During load balancing, the load balancing component filters the metadata information of the discovered target services and obtains a filtered service list;
[0019] Selecting a target service of a physical unit according to the filtered service list;
[0020] When the cluster is expanded, if the database load pressure within the unit has not reached the tolerable upper limit, the service nodes in the service cluster within the unit are expanded. If the upper limit is reached, the unit is expanded horizontally according to the granularity of the unit.
[0021] Optionally, the construction method further includes: a unit management module;
[0022] When a unit in the system fails, the unit management module triggers the unit switching function to switch the main physical subunit of the logical unit to another data center, and at the same time updates the routing strategy and the status of the physical unit to ensure that the gateway inlet traffic can be sent to the correct data center.
[0023] The present invention provides a system and method for building a linear scalability cluster, the building system comprising: dividing into business units and global units according to the data characteristics of the service during deployment; dividing into logical units and physical units from the deployment architecture. Data splitting according to the business dimension reduces the connection bottleneck and capacity bottleneck of a single database, and reduces the fault isolation granularity when the service or database fails. Reduce the service and database load pressure of a single computer room, reduce the fault isolation granularity, solve the complexity of capacity estimation and expansion, reduce the cost of fault switching, and have extremely high linear scalability.
[0024] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0026] Figure 1 An example diagram of a dual-center deployment architecture in the same city provided by an embodiment of the present invention;
[0027] Figure 2 A logic flow chart of unit routing addressing provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0029] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0030] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0031] The present invention introduces a deployment method with unit as the granularity. A unit refers to a self-contained set that can complete all business operations. The set includes all services required for all businesses and the data allocated to this unit, that is, in the form of full service + partial data.
[0032] During deployment, the service is divided into two units according to its data characteristics: Business unit: data that can be split according to business elements, and a collection of related business services for business data.
[0033] When splitting data, ensure that all subsequent business transactions and generated business data for business elements are integrated into the same business unit. Therefore, the data of any business unit is a part of the full business data divided by dimension, and the service is all the business services that generate or consume this data, and the services in each business unit are completely consistent.
[0034] Global unit: Data that cannot be split, such as configuration information and service registration information. Global data and services for these data, such as registration center, configuration center, and multi-tenant isolation, will be relied upon by business units. In terms of deployment, they are generally deployed in multiple regions. If necessary, data synchronization is used between regions. When a business unit makes a dependent call, it will give priority to calling the services of the data center in the region.
[0035] Two concepts arise from the deployment architecture:
[0036] A logical unit is a collection of physical units that target the same data shard.
[0037] The physical unit is the embodiment of a logical unit under a specific physical deployment architecture. A logical unit is deployed as multiple physical units, which are distributed in different computer rooms to form a high-availability mode with one master and multiple backups, achieving center-level disaster recovery. The service cluster within the unit is a highly available deployment architecture.
[0038] The method details are as follows:
[0039] Plan business data, estimate the data capacity of each business unit, and shard data according to certain business elements. The sharding logic is reflected in the agreed algorithm, and different business data shards fall into different business units. Related business operations for the same business element should be converged within the same business unit as much as possible. By having each unit have its own independent data, the single database connection bottleneck and capacity bottleneck are significantly reduced, and the fault isolation granularity when the service or database fails is reduced.
[0040] When deploying a service through the deployment center, you can extend the attributes of the logical unit and physical unit to which the service belongs in the metadata definition of the registration information, and write the attributes to the registration center together when the service is registered.
[0041] When requesting a service, the request traffic must carry business element information, and the relevant information of the element can be associated to find it. All business operations carry unit-sliced business elements, and ultimately all related business data falls into the same unit, avoiding the delay problem caused by cross-computer room calls.
[0042] During the routing phase, the gateway layer or the outgoing caller obtains the sharded business elements in the request information, calls the global routing system, and determines the target logical unit of the call according to the business elements.
[0043] During load balancing, the load balancing component filters the metadata information of the discovered target service and only obtains services that are consistent with the logical unit. In the filtered service list, a physical unit's target service is selected through the load strategy. The physical unit is deployed in multiple data centers, and the center-affinity strategy and the specified center strategy are selected.
[0044] When expanding the cluster, if the database load pressure in the unit has not reached the tolerable upper limit, the service node in the service cluster in the unit is expanded. If the upper limit has been reached, the unit needs to be expanded horizontally according to the unit granularity. This reduces the complexity of capacity estimation and expansion. It eliminates the bottleneck of services and databases and improves the ability of horizontal expansion.
[0045] When a unit fails or has low availability, the unit management system triggers the unit switching function, switches the main physical unit of the logical unit to another data center, and updates the routing strategy and physical unit status to ensure that the gateway inlet traffic can be sent to the correct data center. This reduces the complexity of fault switching. When a fault occurs, only the faulty unit needs to be switched, without the need to redistribute traffic, thus avoiding the complexity of room-level switching.
[0046] The above method involves the following systems or components: the deployment center supports unit-oriented deployment, and can select the logical units and physical units to be deployed during the deployment phase, select resources within the deployment resource range bound to the physical unit for deployment, and dynamically write the logical units and physical units to which the service belongs when the deployment starts.
[0047] The global routing system is divided into global routing service and global routing SDK, including:
[0048] The global routing service provides the ability to maintain and query the mapping relationship between business elements, such as customer numbers and account numbers, and logical units, persists the mapping relationship data, and provides two-level cache to speed up the query. The first-level cache stores the full mapping data in shards based on the redis cluster mode, and the second-level cache stores hotspot mapping data based on the local cache. The LRU replacement algorithm is used to ensure the cache hit rate.
[0049] The global routing SDK provides the ability to calculate the logical units corresponding to the sharded business elements based on an algorithm for local application integration. The algorithm implements the business data sharding rules described in the above method detail 1, and establishes a local cache to store the calculated results, using the LRU replacement algorithm to ensure the hit rate.
[0050] When using the global routing system, users can choose one as the unit computing capability, or use a combination of the two.
[0051] The unit management system is responsible for the definition of logical units and physical units, the relationship between management units and physical deployment resources, the maintenance of unit status information, and the ability to switch units in case of failure. When switching units, the unit management system changes the physical unit status of the logical unit and publishes the new unit status information to the service cluster. The service receives the new unit status and changes the routing strategy.
[0052] The load balancing component is integrated and used inside the gateway or application. During load balancing, it is responsible for selecting the appropriate target service instance based on the target logical unit. The policy configuration can be used to select the service instance of the same center or the specified center.
[0053] Data splitting by business dimension reduces single database connection bottlenecks and capacity bottlenecks, and reduces the fault isolation granularity when a service or database fails.
[0054] The multi-level cache mechanism of the global routing system, combined with the local algorithm, can ensure that the target unit is quickly obtained when the request is forwarded. When the unit is switched, there is no need to allocate upper-layer traffic. The gateway will automatically forward the request according to the new unit status.
[0055] Example of dual-center deployment architecture in the same city:
[0056] like Figure 1 As shown, a schematic diagram of a unitized deployment architecture is shown, taking the dual-center deployment architecture in the same city as an example. The center-level load sends a request to gateway 1. The gateway disassembles the business elements in the request information, requests the global routing service or the local global routing SDK, obtains the target unit 2, and then forwards the request 3 to the service APP1 of the business unit under this center. When APP1 calls other services, if they belong to the same business element, it directly calls other services of this unit. If they do not belong to the same business element, such as a bank transfer scenario, it requests the global routing service or the local global routing SDK to obtain the target unit 4, and then calls the service request 5 of the target unit under the same center.
[0057] Cell routing addressing logic, such as Figure 2 shown.
[0058] Beneficial effects: Data splitting by business dimension reduces single database connection bottlenecks and capacity bottlenecks, and reduces fault isolation granularity when services or databases fail. It reduces the service and database load pressure of a single computer room, reduces fault isolation granularity, solves the complexity of capacity estimation and expansion, reduces the cost of fault switching, and has extremely high linear expansion capabilities.
[0059] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for building a linear scalability cluster, applied to building a system, characterized in that: The construction system comprises: During deployment, services are divided into business units and global units according to their data characteristics. From the deployment architecture, it is divided into logical units and physical units; The business unit is a collection of data that can be split according to business elements and services related to these business data; The global unit is a collection of global services and data they face that are relied upon by all business units; The logical unit includes a set of the physical units facing the same data slice; The physical unit master and backup should be distributed in different computer rooms to form a high-availability mode with one master and multiple backups to achieve center-level disaster recovery; The construction method comprises: Plan business data, estimate the data capacity of each business unit, and shard data according to business elements. Different business data shards fall into different business units. Related business operations for the same business element are converged into the same business unit; When the service is deployed, it is deployed through the deployment center. In the metadata definition of the registration information, the attributes of the logical unit and the physical unit of the service are extended. When the service is registered, the attributes are written into the registration center together. When a service request is made, the request traffic carries the service elements; Obtain the sharding business elements in the request information, call the global routing system, and determine the target logical unit to be called according to the business elements; During load balancing, the load balancing component filters the metadata information of the discovered target services and obtains a filtered service list; Selecting a target service of a physical unit according to the filtered service list; When the cluster is expanded, if the database load pressure within the unit has not reached the tolerable upper limit, the service nodes in the service cluster within the unit are expanded. If the upper limit is reached, the unit is expanded horizontally according to the granularity of the unit.
2. A method for building a linear scalability cluster according to claim 1, characterized in that: The construction method further comprises: a unit management module; When a unit in the system fails, the unit management module triggers the unit switching function to switch the main physical subunit of the logical unit to another data center, and at the same time updates the routing strategy and the status of the physical unit to ensure that the gateway inlet traffic can be sent to the correct data center.
Citation Information
Patent Citations
Method and device for protecting business in cluster system
CN102143063A
Application system testing method and device
CN106201860A