Data synchronization methods, distributed systems and application nodes
By setting up built-in storage space in the application nodes of the distributed system and utilizing the state synchronization mechanism of the cluster management node, the problems of network latency and I/O limitations are solved, achieving efficient data access and a simplified system architecture, thereby improving the system's processing efficiency and robustness.
Patent Information
- Application Number
- CN201811084187.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-09-17
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2038-09-17
AI Technical Summary
In existing distributed systems, when application nodes synchronize data with external cache nodes, latency issues caused by network delays and I/O limitations have not been effectively resolved, affecting system processing efficiency.
By setting up built-in storage space in the application nodes of the distributed system, and using the state synchronization mechanism of the cluster management node, database data is loaded into the built-in storage space of the application nodes, realizing data synchronization and updating of each application node, and directly accessing the local storage space to reduce network latency and I/O limitations.
It improves access performance in low-frequency write and high-frequency read scenarios, simplifies system architecture, reduces maintenance costs, and enhances system robustness and processing efficiency.
Smart Images

Figure CN109408224B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to data synchronization methods, distributed systems and application nodes. Background Technology
[0002] In a distributed system, each application node processes business logic indiscriminately and operates on a peer-to-peer basis. These stateless application nodes can easily scale horizontally to handle increased traffic. Because each application node processes business requests indiscriminately and the distribution of these requests is random, memory synchronization between application nodes is crucial for ensuring the data integrity of the distributed system.
[0003] In existing distributed systems, application nodes handle business processes indiscriminately, while the database stores data. When an application node receives a data query or processing request, it needs to retrieve data from the database. However, retrieving data from the database by the application node incurs significant network latency. For data processing-related tasks, network latency can be reduced by configuring externally mounted cache nodes for each application node. This allows data to be synchronized with the database through the externally mounted cache nodes. Thus, when performing data processing tasks, the application node can directly read data from its corresponding externally mounted cache node.
[0004] Existing data synchronization methods add extra external cache nodes to each application node. The read and write requests initiated by the application node to its corresponding external cache node are limited by network bandwidth and the number of concurrent read and write requests, and the latency problem of business processing still needs to be solved. Summary of the Invention
[0005] This application provides a data synchronization method, a distributed system, and application nodes, aiming to reduce latency during data request in a distributed system and improve system processing efficiency.
[0006] Firstly, this application provides a data synchronization method applied to a distributed system, which further includes a load balancer, a database, a cluster management node, a first application node, and a second application node. The method includes: the first application node loading application data recorded in the database into a first built-in storage space; the second application node loading application data recorded in the database into a second built-in storage space; the first application node receiving a data update request for application data in the database from a client sent by the load balancer; thereby, the first application node updating the application data recorded in the database according to the data update request and notifying the cluster management node that the database is in an updated state; furthermore, when the first application node detects that the database is in an updated state, it updates the application data of the database in the updated state to the first built-in storage space; and when the second application node detects that the database is in an updated state, it updates the application data of the database in the updated state to the second built-in storage space.
[0007] The solution provided in this embodiment enables each application node to synchronously store application data in the database using its own built-in storage space. Thus, when data processing is involved, the local built-in storage space can be directly accessed without being affected by input / output (I / O) limitations and network latency, thereby improving access performance in low-frequency write and high-frequency read scenarios.
[0008] In one implementation of this application, if a data update request carries data to be updated, the first application node updates the application data recorded in the database according to the data update request, including: the first application node updates the application data recorded in the database to the data to be updated.
[0009] In this application, the first application node can directly update the data in the database according to the data update request, and the first application node can directly write to the database, which has high flexibility.
[0010] In another implementation of this application, the data update request also carries the location of the application data to be updated in the database, and the first application node updates the application data recorded in the database to the data to be updated, including: the first application node updates the application data to be updated in the database to the data to be updated.
[0011] In this implementation, the first application node can process the data in the database in a targeted manner. For the first application node, there is no need to update the entire database or determine the storage location of the data to be updated. This simplifies the processing steps, improves processing efficiency, and the more targeted processing method allows the updated data to be stored in the location specified in the data update request, which is convenient for subsequent calls or updates.
[0012] In another implementation of this application, the method further includes: a first application node receiving a first data query request for a database from a client sent by a load balancer; the first application node querying application data matching the first data query request in a first built-in storage space, and sending the queried application data to the client.
[0013] The solution provided in this embodiment allows the first application node to directly feed back data stored in the first built-in storage space to the client without needing to retrieve data from the database, thus reducing feedback latency and improving feedback efficiency.
[0014] In another implementation of this application, the method further includes: a second application node receiving a second data query request for the database from a client sent by a load balancer; the second application node querying application data matching the second data query request in a second built-in storage space, and sending the queried application data to the client.
[0015] The solution provided in this embodiment allows the second application node to directly feed back data stored in the second built-in storage space to the client without needing to retrieve data from the database, thus reducing feedback latency and improving feedback efficiency.
[0016] In another implementation of this application, the distributed system also includes data nodes, and the database is set on the data nodes.
[0017] The solution provided in this embodiment further reduces the system architecture complexity of the distributed system, simplifies later maintenance costs, and improves the robustness of the distributed system.
[0018] Secondly, this application provides a data synchronization method applied to a first application node, which is located in a distributed system. The distributed system also includes a load balancer, a database, a cluster management node, and a second application node. Application data recorded in the database is loaded into a first built-in storage space of the first application node and a second built-in storage space of the second application node. The method includes: the first application node loading the application data recorded in the database into the first built-in storage space; the first application node receiving a data update request for the application data in the database from a client sent by the load balancer; the first application node updating the application data recorded in the database according to the data update request and notifying the cluster management node that the database is in an updated state; and the first application node updating the application data recorded in the database in the updated state to the first built-in storage space when it detects that the database is in an updated state.
[0019] The solution provided in this embodiment enables the first application node to update the application data recorded in the database upon receiving a data update request. Simultaneously, through the notification mechanism of the cluster management node, the data stored by each application node is updated synchronously. In this way, each application node can utilize its own built-in storage space to synchronously store application data in the database. Therefore, when data processing is involved, it can directly access its local built-in storage space without being affected by I / O limitations and network latency, improving access performance in low-frequency write and high-frequency read scenarios.
[0020] In one implementation of this application, the data update request carries data to be updated, and the first application node updates the application data recorded in the database according to the data update request, including: the first application node updates the application data recorded in the database to the data to be updated.
[0021] In this application, the first application node can directly update the data in the database according to the data update request, and the first application node can directly write to the database, which has high flexibility.
[0022] In another implementation of this application, the data update request also carries the location of the application data to be updated in the database, and the first application node updates the application data recorded in the database to the data to be updated, including: the first application node updates the application data to be updated in the database to the data to be updated.
[0023] In this implementation, the first application node can process the data in the database in a targeted manner. For the first application node, there is no need to update the entire database or determine the storage location of the data to be updated. This simplifies the processing steps, improves processing efficiency, and the more targeted processing method allows the updated data to be stored in the location specified in the data update request, which is convenient for subsequent calls or updates.
[0024] In another implementation of this application, the method further includes: a first application node receiving a first data query request for a database from a client sent by a load balancer; the first application node querying application data matching the first data query request in a first built-in storage space, and sending the queried application data to the client.
[0025] The solution provided in this embodiment allows the first application node to directly feed back data stored in the first built-in storage space to the client without needing to retrieve data from the database, thus reducing feedback latency and improving feedback efficiency.
[0026] In another implementation of this application, the distributed system also includes data nodes, and the database is set on the data nodes.
[0027] The solution provided in this embodiment further reduces the system architecture complexity of the distributed system, simplifies later maintenance costs, and improves the robustness of the distributed system.
[0028] Thirdly, this application provides a data synchronization method applied to a second application node, which is set in a distributed system. The distributed system also includes a load balancer, a database, and a cluster management node. The application data recorded in the database is loaded into the built-in storage space of the second application node. The method includes: the second application node monitoring whether the status of the database recorded by the cluster management node is in an updated state; if so, the second application node updates the application data recorded in the database in the updated state to the built-in storage space of the second application node.
[0029] The solution provided in this embodiment enables the second application node to synchronously update the application data recorded in the database when it detects that the database recorded by the cluster management node is in an update state. In this way, each application node can use its own built-in storage space to synchronously store the application data in the database. Thus, when data processing is involved, it can directly access the local built-in storage space without being affected by I / O limitations and network latency, thereby improving access performance in low-frequency write and high-frequency read scenarios.
[0030] In one implementation of this application, the method further includes: a second application node receiving a data query request for the database from a client sent by a load balancer; the second application node querying application data matching the data query request in its built-in storage space, and sending the queried application data to the client.
[0031] The solution provided in this embodiment allows the second application node to directly feed back data stored in its built-in storage space to the client without needing to retrieve data from the database, thus reducing feedback latency and improving feedback efficiency.
[0032] In another implementation of this application, the method further includes: a second application node receiving a data update request for application data in the database from a client sent by a load balancer; the second application node updating the application data recorded in the database according to the data update request, and notifying the cluster management node that the database is in an updated state.
[0033] In this application, the second application node can directly update the data in the database according to the data update request, and the second application node can directly write to the database, which has high flexibility. In addition, the second node notifies the cluster management node to modify the database status, and the cluster management node assumes the notification role, which can facilitate other nodes to update and synchronize data according to the status.
[0034] In another implementation of this application, the distributed system also includes data nodes, and the database is set on the data nodes.
[0035] The solution provided in this embodiment further reduces the system architecture complexity of the distributed system, simplifies later maintenance costs, and improves the robustness of the distributed system.
[0036] Fourthly, this application provides a distributed system, comprising: a load balancer, a database, a cluster management node, a first application node, and a second application node. The first application node is used to load application data recorded in the database into a first built-in storage space. The second application node is used to load application data recorded in the database into a second built-in storage space. The load balancer is used to receive data update requests for application data in the database sent by clients and send the data update requests to the first application node. The first application node is further used to update the application data recorded in the database according to the data update requests and notify the cluster management node that the database is in an updated state. The first application node is further used to update the application data of the database records in the updated state to the first built-in storage space when it detects that the database records in the cluster management node are in an updated state. The second application node is further used to update the application data of the database records in the updated state to the second built-in storage space when it detects that the database records in the cluster management node are in an updated state.
[0037] The fourth aspect or any implementation thereof is a device implementation corresponding to the first aspect or any implementation thereof. The description in the first aspect or any implementation thereof applies to the fourth aspect or any implementation thereof, and will not be repeated here.
[0038] Fifthly, this application provides an application node with built-in storage space. The application node includes: a loading module for loading application data recorded in a database into the built-in storage space; a receiving module for receiving data update requests for application data in the database from a client sent by a load balancer; an updating module for updating the application data recorded in the database according to the data update requests and notifying the cluster management node that the database is in an updated state; and a monitoring module for updating the application data of the database records in the updated state to the built-in storage space when the cluster management node detects that the database is in an updated state.
[0039] The fifth aspect or any implementation thereof is a device implementation corresponding to the second aspect or any implementation thereof. The description in the second aspect or any implementation thereof applies to the fifth aspect or any implementation thereof, and will not be repeated here.
[0040] Sixthly, this application provides an application node with built-in storage space. The application node includes: a monitoring module for monitoring whether the status of the database recorded by the cluster management node is in an updated state; and an update module for updating the application data recorded in the database in the updated state to the built-in storage space of the second application node.
[0041] The sixth aspect or any implementation thereof is a device implementation corresponding to the third aspect or any implementation thereof. The description in the third aspect or any implementation thereof applies to the sixth aspect or any implementation thereof, and will not be repeated here.
[0042] In a seventh aspect, this application provides an application node, comprising: a processor and a memory, wherein the memory stores an application program, and the processor runs the application program using the data synchronization method of any one of the second and / or third aspects.
[0043] Eighthly, this application provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform a data synchronization method as described in the second and / or third aspects.
[0044] Ninthly, this application provides a computer program, which, when executed by a computer, performs the data synchronization method of any one of the second and / or third aspects.
[0045] In one possible design, the program in aspect nine can be stored wholly or partially on a storage medium packaged with the processor, or it can be stored wholly or partially on a memory not packaged with the processor.
[0046] As can be seen, in all the above aspects, by moving the caching function to the application nodes, and having the built-in storage space in each application node synchronously update data with the database, business operations involving data processing can directly access the local built-in storage space without being affected by I / O limitations and network latency, thus improving access performance in low-frequency write and high-frequency read scenarios. Furthermore, compared to setting up external cache nodes, the technical solution provided in this application can reduce the deployment of external caches in the distributed system, greatly simplifying later maintenance costs and improving system robustness. Therefore, the technical solution provided in this application can reduce latency during data request in the distributed system and improve system processing efficiency. Attached Figure Description
[0047] Figure 1 This application provides a schematic diagram of the architecture of a distributed system.
[0048] Figure 2A schematic diagram of the interaction process of a data synchronization method provided in this application;
[0049] Figure 3 A schematic diagram of the interaction process for another data synchronization method provided in this application;
[0050] Figure 4 A schematic diagram of the interaction process for another data synchronization method provided in this application;
[0051] Figure 5 This application provides a schematic diagram of another distributed system architecture.
[0052] Figure 6 A functional block diagram of an application node provided in this application;
[0053] Figure 7 A schematic diagram of the entity architecture of an application node provided in this application;
[0054] Figure 8 A functional block diagram of another application node provided in this application;
[0055] Figure 9 This is a schematic diagram of the entity architecture of another application node provided in this application. Detailed Implementation
[0056] The terminology used in the implementation section of this application is for the purpose of explaining specific embodiments of this application only, and is not intended to limit this application.
[0057] The embodiments of this application can be applied to distributed systems.
[0058] A distributed storage system typically consists of a load balancer (LB), a database (DB), and multiple application nodes (APIs). The database stores business data, while the application nodes in this distributed system are peer-to-peer nodes without distinction. These application nodes do not store business data and are easily scalable to handle increased business traffic. The load balancer is positioned at the front-end entry point of the multiple application nodes to evenly distribute access requests, allowing each application node to process requests without discrimination. These access requests include at least one of the following: database query requests and data update requests.
[0059] Existing distributed systems, in scenarios involving data processing, are limited by network latency, whether retrieving data directly from the database or through external caching nodes. This results in low data processing efficiency and may not meet the requirements for low-latency scenarios after high-frequency queries and verifications. Therefore, solving the latency problem in existing distributed systems and ensuring memory synchronization of stateless nodes is a pressing technical challenge in this field.
[0060] Based on this, the data synchronization method provided in this application aims to solve the above-mentioned technical problems of the prior art, and proposes the following solution: set up built-in storage space in each application node of the distributed system, and synchronize the data in the built-in storage space with the database data, so that when processing business involving data processing, data can be directly retrieved from its own built-in storage space, reducing network latency and improving processing efficiency.
[0061] The technical solutions of the present invention and how they solve the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0062] First, for ease of understanding, this application provides a schematic diagram of a distributed system architecture. Please refer to... Figure 1 The distributed system 100 includes: a load balancer 11, a database 12, a cluster management node (Configuration ServerCluster) 13, a first application node 14, and a second application node 15. The first application node 14 has a first built-in storage space, and the second application node 15 has a second built-in storage space. Figure 1 The ellipsis in the text indicates that the distributed system may have one or more other application nodes.
[0063] exist Figure 1 In the distributed system 100 shown, the load balancer 11 is used to evenly distribute access requests, thereby enabling each application node to process requests without discrimination. These access requests include at least one of the following: database query requests and data update requests. Figure 1 As shown, the load balancer 11 can communicate and exchange data with external clients 200 via the network. For example, the load balancer 11 can receive data query requests sent by the client 200 via the network and send the data query requests to the first application node 14 for processing.
[0064] Database 12 serves as a persistent database within the distributed system 100, used to store all data. Therefore, all data update and data loading requests are ultimately completed within this database.
[0065] In this distributed system 100, cluster management node 13 acts as the configuration center, receiving configuration distribution requests from application nodes and recording the database status. When an application node detects that the status recorded by cluster management node 13 is "updated," it requests the database to load the updated data into its own built-in storage space. The database status represented by cluster management node 13 may include, but is not limited to, an "updated" status, indicating that data in the database has been updated.
[0066] The first application node 14 and the second application node 15 are stateless nodes, and they are peer-to-peer in this distributed system. Peer-to-peer means that the load balancer 11 sends one or more access requests for database 12 from outside the distributed system to any application node for processing. The load balancer 11 distributes access requests to application nodes with lower loads based on their load conditions. Any application node can access database 12 and send the access results to the client. The application nodes in this distributed system 100 are responsible for receiving update requests from clients and sending the data carried in the update requests to database 12 to modify it. If the transmission is successful, the changes are synchronized to the cluster management node 13.
[0067] In other examples, load balancer 11 may send access requests to the corresponding application nodes according to a hash consistency algorithm.
[0068] It should be noted that in the embodiments of this application, "first" and "second" are only used to distinguish the roles played by the application nodes in the data synchronization process. The first application node is the application node that actively updates the database, while the second application node is the application node that is passive and only performs data synchronization updates when the database is in an updated state.
[0069] It's important to note that the roles of the first and second application nodes can switch between different application nodes during different data synchronization processes. For example, in one data synchronization scenario, application node A, as the application node receiving the data synchronization request, is the first application node and actively updates the data in the database records. Application node B, as the second application node, only performs data synchronization when the database is in an update-required state. Conversely, in another data synchronization scenario, application node B, as the application node receiving the data synchronization request, is the first application node and actively updates the data in the database records. Application node A, as the second application node, only performs data synchronization when the database is in an update-required state.
[0070] Furthermore, in this distributed system 100, there can be multiple first application nodes 14 and multiple second application nodes 15. Figure 1 The number and type of the first application node 14 and the second application node 15 included in the distributed system shown are merely examples, and the embodiments of this application are not limited thereto.
[0071] like Figure 1 In the distributed system 100 shown, the application nodes have caching capabilities, that is, each application node has built-in storage space. The built-in storage space can take the form of, but is not limited to, cache or memory.
[0072] Because of the built-in storage space, application nodes can directly read the data cached in their own built-in storage space when processing data-related business. This reading method has no I / O latency, no network latency, and is not limited by the bottleneck of the number of concurrent requests, which can improve access performance in low-frequency write and high-frequency read scenarios.
[0073] In this embodiment of the application, "multiple" refers to two or more, and other quantifiers are similar. "And / or" describes the correspondence between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0074] The following will combine Figure 1 The distributed system 100 shown illustrates a data synchronization method provided in this application. Please refer to [reference needed]. Figure 2 The data synchronization method may include the following steps:
[0075] S201, the first application node 14 loads the application data recorded in the database 12 into the first built-in storage space of the first application node 14.
[0076] S202, the second application node 15 loads the application data recorded in the database 12 into the second built-in storage space of the second application node 15.
[0077] S203, Client 200 sends a data update request for application data in the database to Load Balancer 11 of Distributed System 100.
[0078] S204, the load balancer 11 forwards the received data update request to the first application node 14.
[0079] S205, the first application node 14 receives a data update request from the load balancer 11 for the application data of the database 12.
[0080] S206, the first application node 14 updates the application data recorded in database 12 according to the data update request.
[0081] S207, the first application node 14 notifies the cluster management node 13 that the status of the record database 12 is being updated.
[0082] S208, the first application node 14 monitors the status of database 12 recorded by cluster management node 13.
[0083] S209, The second application node 15 monitors the status of database 12 recorded by cluster management node 13.
[0084] S210, when the first application node 14 detects that the status of the database 12 recorded by the cluster management node 13 is in the updating state, it updates the application data recorded in the database 12 in the updating state to the first built-in storage space of the first application node 14.
[0085] S211, when the second application node 15 detects that the status of the database 12 recorded by the cluster management node 13 is in the updating state, it updates the application data recorded in the database 12 in the updating state to the second built-in storage space of the second application node 15.
[0086] As described above, in this embodiment, the first application node 14 and the second application node 15 are identical nodes. Therefore, this embodiment does not have a particular limitation on the implementation order of the same steps performed by the first application node 14 and the second application node 15. In specific implementation, they can be executed simultaneously, or they can be executed in a preset order. For example, S201 and S202 can be executed simultaneously, or S201 can be executed first and then S202, or S202 can be executed first and then S201. In addition, S208 and S209, and S210 and S211 are also the same, and will not be described again.
[0087] In this embodiment of the application, since each application node has built-in storage space, in order to ensure that the data stored in the built-in storage space of the application node is consistent with the data stored in the database 12 during the business processing, so that each application node can process the business without difference, S201 and S202 are executed.
[0088] In a specific implementation scenario, the "application data recorded in database 12" involved in steps S201 and S202 can be all the data recorded and stored in database 12.
[0089] In another specific implementation scenario, the "application data recorded in database 12" involved in steps S201 and S202 can be application data related to the business that the application node needs to process, from all the data recorded and stored in database 12. The business that the application node needs to process can include, but is not limited to, at least one of the following: the business that the application node is currently processing, and one or more business transactions that the application node needs to process next.
[0090] Furthermore, in specific implementation scenarios, the application data loaded from database 12 to the internal storage space of each application node, including the first application node 14 and the second application node 15, can be the same or different. It should be noted that since each application node needs to process business logic uniformly, the data loaded into its internal storage space must include the business data that the application node needs to process. In a preferred implementation scenario, the application data loaded into the internal storage space of the first application node 14 and the second application node 15 is the same. This simplifies the control strategy for each application node and reduces the complexity of the system.
[0091] For example, if database 12 stores application data for business A, business B, and business C, and the first application node 14 and the second application node 15 are currently processing business A without distinction, then when executing S201 and S202, the first application node 14 can load the application data (partial data) of business A stored in database 12 into the first built-in storage space, and the second application node 15 can load the application data (all data) of business A, business B, and business C stored in database 12 into the second built-in storage space.
[0092] When loading application data recorded in database 12 into its own built-in storage space, the application node can do so by sending a data loading request to database 12.
[0093] For details, please refer to Figure 3 On the one hand, step S201 includes:
[0094] S2011, the first application node 14 sends a data loading request to the database 12, which is used to request the loading of application data recorded in the database 12.
[0095] S2012, Database 12 sends the application data requested by the first application node 14 to the first application node 14 according to the data loading request.
[0096] S2013, the first application node 14 stores the application data sent by the database 12 into the first built-in storage space.
[0097] Still Figure 5 As shown, on the other hand, step S201B includes:
[0098] S2021, the second application node 15 sends a data loading request to the database 12, which is used to request the loading of application data recorded in the database 12.
[0099] S2022, Database 12 sends the application data requested by the second application node 15 to the second application node 15 according to the data loading request.
[0100] S2023, the second application node 15 stores the application data sent by the database 12 into the second built-in storage space.
[0101] Furthermore, in this embodiment, the triggering conditions for S201 and S202 may include, but are not limited to, the application node's own built-in storage space not storing business data related to the business. For example, the application node may execute these steps at startup.
[0102] For example, if any application node's built-in storage space does not store business data related to the business, then the data stored by the application node itself cannot meet the business processing needs of the first application node 14. Furthermore, when data processing is involved, the application node still needs to call data from the database 12, which results in I / O latency issues. Therefore, when the application node is first enabled, the above data loading steps are performed.
[0103] Specifically, if the application node's built-in storage space does not store business data related to the business, this can include, but is not limited to, the following two situations:
[0104] The first scenario is when the application node is used for the first time. At this time, the application node's internal storage space is also in its initial state, and may not have any data stored; the internal storage space is empty.
[0105] The second scenario involves application nodes having some data stored in their built-in storage space, but not application data related to the business processes that need to be processed.
[0106] In this embodiment, each application node has its own built-in storage space. Since each application node processes business indiscriminately in the distributed system, it is necessary to ensure that the memory of each application node is synchronized. Therefore, when the first application node 14 receives a data update request from the client for the application data in the database 12, it needs to update the application data recorded in the database 12 according to the data update request, and notify the cluster management node 13 in the distributed system so that the cluster management node 13 can modify the state of the database 12 to the updated state.
[0107] In this embodiment of the application, each application node can write data into the database 12 according to the data update request.
[0108] Thus, if the data update request received by the first application node 14 carries data to be updated, the first application node 14 can update the application data recorded in the database 12 with the data to be updated when performing the step of updating the database 12 in S206.
[0109] If the data to be updated is all the data recorded in database 12, then the above update and replacement steps can be performed directly; or, if the data to be updated is only part of the data recorded in database 12, then the location of the data to be updated needs to be further confirmed.
[0110] In a specific implementation process, if the data to be updated is part of the data recorded in database 12, the data to be updated can be stored in any location in database 12 or in a pre-specified location. In this case, no other processing is required on the data originally stored in database 12, that is, only the data to be updated needs to be stored in database 12.
[0111] In another specific implementation process, if the data to be updated is a portion of the data recorded in database 12, the identification information of the data to be updated can be determined. The identification information may include, but is not limited to, type information, which may include, but is not limited to, data type and / or business type. Based on the identification information of the data to be updated, the data to be replaced recorded in database 12 corresponding to the data to be updated can be determined, and then the data to be replaced can be replaced with the data to be updated to complete the data update.
[0112] In addition, in some application scenarios, the data update request received by the first application node 14 may also carry the location of some application data that needs to be updated in the database 12. In this case, when the first application node 14 performs the step of updating the database 12 in S206, it can update the data that needs to be updated in the location of the database 12 to the data to be updated.
[0113] In addition, in a special implementation scenario, the data update request received by the first application node 14 may not carry the location of the data to be updated and the application data to be updated in the database 12. In this case, the first application node 14 can operate on the application data recorded in the database 12 according to the operation indicated to the data update request.
[0114] For example, if the data update request received by the first application node 14 is to delete the application data of service A, and the data update request does not carry the data to be updated, then the first application node 14 can delete the application data of service A according to the data update request.
[0115] Alternatively, for example, if the data update request received by the first application node 14 is to add application data for business C, and the application data for business C is exactly the same as the application data for business A, then the first application node 14 can copy the application data for business A, add the identifier of business C to the copied data, and store the data as application data for business C in the database 12.
[0116] In addition to updating the data recorded in database 12, the first application node 14 also needs to notify the cluster management node 13 to record that database 12 is in an update-being state. In the distributed system, each application node monitors the status information of database 12 recorded by the cluster management node 13 after startup. Thus, when any application node in the distributed system, including the first application node 14 and the second application node 15, detects that the status of database 12 recorded by the cluster management node 13 is in an update-being state, it can execute the update synchronization steps described in S210 and S211.
[0117] In a preferred implementation, during step S206, the first application node 14 may first execute the step of updating the application data recorded in database 12 according to the data update request. After this data update step is completed (in some possible scenarios, after the data to be updated has been sent to database 12), the step of notifying cluster management node 13 is then executed. This implementation method can ensure that the state of cluster management node 13 is accurate, avoiding the problem of inaccurate state recorded by cluster management node 13 when data update fails despite prior notification. Therefore, it also avoids resource waste caused by application nodes updating and synchronizing data when the state of database 12 recorded by cluster management node 13 is inaccurate.
[0118] As can be seen, the above is a preferred implementation process. In the actual implementation of step S206, the embodiments of this application do not have any particular limitations. Steps S206 and S207 can also be executed simultaneously, which can improve the processing efficiency to a certain extent. In addition, S207 can be executed first and then S206 can be executed.
[0119] Based on the fact that the status of database 12, recorded in cluster management node 13, is in an "updating" state, each application node can request updated and synchronized data from database 12 based on this status. For implementation details, please refer to [link / reference needed]. Figure 3 It includes the following steps:
[0120] On the one hand, step S210 includes:
[0121] S2101, the first application node 14 sends a data synchronization request to the database 12, which requests the synchronization and updating of the data in the database 12.
[0122] The data updated in database 12 may include, but is not limited to: all the data in database 12, or the data to be updated when the first application node 14 updates database 12 in step S203; or, a portion of the data to be updated in database 12.
[0123] S2102, Database 12 sends the application data requested by the first application node 14 to the first application node 14 according to the data synchronization request.
[0124] S2103, the first application node 14 stores the application data sent by the database 12 into the first built-in storage space.
[0125] Still Figure 3 As shown, on the other hand, step S211 includes:
[0126] S2111, the second application node 15 sends a data synchronization request to the database 12. This data update request is used to request the synchronization and updating of the data in the database 12.
[0127] The data updated in database 12 may include, but is not limited to: all the data in database 12, or the data to be updated when the first application node 14 updates database 12 in step S203; or, a portion of the data to be updated in database 12.
[0128] S2112, Database 12 sends the application data requested by the second application node 15 to the second application node 15 according to the data synchronization request.
[0129] S2113, the second application node 15 stores the application data sent by the database 12 into the second built-in storage space.
[0130] As mentioned above, the data requested in the data synchronization request and the aforementioned data loading request can be the same, which is all the data recorded in database 12; or, the two can be different.
[0131] Furthermore, in a feasible implementation scenario, after receiving a data update request in S205, the first application node 14 can also update the application data recorded in its own first built-in storage space. For example, if the data update request received by the first application node 14 in S205 carries data to be updated, in addition to executing S206, it can also update the data to be updated to its own first built-in storage space in advance. Figure 3 In the process shown, there is no need to execute steps S101-S2103 again, which can save operation steps and reduce resource consumption.
[0132] In another feasible implementation scenario, if, in S207, the first application node 14, in addition to notifying the cluster management node 13 to record the status of the database 12, can also notify the cluster management node 13 to record the initiator information of this update to the database 12, then when the first application node 14 executes S210, it determines, based on the initiator information, that it is itself that initiated this update to the database 12, and that it has already updated the data in its own first built-in storage space upon receiving the data update request. Therefore, there is no need to perform the update operation on the first built-in storage space again. Of course, to avoid data inconsistency, step S210 can also be re-executed. When the first application node 14 notifies the cluster management node 13 of the initiator information, it can send the notification message to record the status of the database 12 together with the notification message, or it can be sent as two separate notification messages. This embodiment of the application does not particularly limit this.
[0133] Furthermore, in another feasible implementation scenario, if the data update request received by the first application node 14 carries the location of the data to be updated and the portion of application data to be updated in the database 12, the first application node 14, in S207, in addition to notifying the cluster management node 13 of the status of the database 12, can also notify the cluster management node 13 of this location information. Similarly, the notification message of this location information can be sent together with the notification message notifying it of the status of the database 12, or it can be sent as two separate notification messages; this embodiment of the application does not particularly limit this. In this scenario, after each application node receives the notification message, it can request the database 12 to synchronously update the application data stored at that location.
[0134] Furthermore, in another feasible implementation scenario, if the data update request received by the first application node 14 carries data to be updated, in S207, in addition to notifying the cluster management node 13 of the status of the record database 12, the first application node 14 can also notify the cluster management node 13 of the identification information of the data to be updated, including: data type and / or business type. Similarly, the notification message for this identification information can be sent together with the notification message notifying it of the status of the record database 12, or it can be sent as two separate notification messages; this application embodiment does not particularly limit this. In this scenario, after each application node receives the notification message, it can request the database 12 to synchronously update the application data corresponding to the identification information.
[0135] Through the above steps, the data stored in the built-in storage space of each application node can be synchronized with the data stored in database 12, ensuring that each application node in the distributed system can process business data without difference.
[0136] Based on this, when any application node receives a data query request, it can directly query the application data that matches the data query request in its own built-in storage space and feed back the queried application data to the sender of the data query request.
[0137] For easier understanding, please refer to Figure 4 The data synchronization method also includes the following steps:
[0138] S212, Client 200 sends a first data query request for database 12 to load balancer 11 of distributed system 100.
[0139] S213, the load balancer 11 forwards the received first data query request to the first application node 14.
[0140] S214, the first application node 14 receives the first data query request sent by the load balancer 11.
[0141] S215, the first application node 14 queries the first built-in storage space for application data that matches the first data query request.
[0142] S216, the first application node 14 sends the application data that matches the queried application data to the load balancer 11.
[0143] S217, the load balancer 11 forwards the application data received that matches the first data query request to the client 200.
[0144] On the other hand, in another implementation scenario, such as Figure 4 As shown, the method may further include:
[0145] S218, client 200 sends a second data query request for database 12 to load balancer 11 of distributed system 100.
[0146] S219, the load balancer 11 forwards the received second data query request to the second application node 15.
[0147] S220, the second application node 15 receives the second data query request sent by the load balancer 11.
[0148] S221, the second application node 15 queries the application data that matches the second data query request in the second built-in storage space.
[0149] S222, the second application node 15 sends the application data that matches the queryed application data to the load balancer 11.
[0150] S223, the load balancer 11 forwards the application data received that matches the second data query request to the client 200.
[0151] In this way, when a business involving data processing is received, each application node no longer needs to retrieve data from database 12 or set up external cache nodes. It can directly complete the data processing business through its own built-in storage space.
[0152] In this application, Figure 4 Steps S212-S217 and S218-S223 shown can be completed in the same implementation scenario, or they can be implemented in different implementation scenarios.
[0153] Preferably, the cluster management node 13 involved in the embodiments of this application can be a lightweight configuration node to reduce the impact of the cluster management node 13 on the system architecture complexity of the distributed system 100.
[0154] Furthermore, it should be noted that the data synchronization method provided in the embodiments of this application is also applicable to, for example, Figure 5 The distributed system 100 shown includes a load balancer 11, a database 12, a first application node 14, and a second application node 15. When executing the above data synchronization process, the first application node 14 can be responsible for notifying the database 12 that its status is being updated, or the database 12 can be responsible for notifying itself that its status is being updated.
[0155] That is, when the first application node 14 receives a data update request from the load balancer 11 for the application data of the database 12, the first application node 14 updates the application data recorded in the database 12 according to the data update request. In addition, the first application node 14 also sends a notification message to other application nodes to notify them that the status of the database 12 is updated.
[0156] Alternatively, when the first application node 14 updates the application data recorded in the database 12 according to the data update request, the database 12 sends a notification message that it is in an updated state to each application node.
[0157] This implementation method simplifies the deployment architecture of the distributed system by not adding other nodes, greatly reduces later maintenance costs, and improves the robustness of the system.
[0158] Furthermore, in this embodiment of the application, database 12, in addition to... Figure 1 , Figure 5 In addition to the method shown, the distributed system can also be configured as follows: the distributed system also includes data nodes, and the database 12 is configured on the data nodes.
[0159] In other words, database 12 can be integrated and configured on any one or more application nodes. Since each application node has built-in storage space, the built-in storage space of any one or more application nodes can be used as database 12 to store all application data. It should be noted that the data stored on the application node used as the built-in storage space of database 12 may differ from that stored on other application nodes. This depends on whether the data requested for synchronization or loading by each application node from database 12 is the same during the aforementioned data synchronization process.
[0160] It is understood that some or all of the steps or operations in the above embodiments are merely examples, and other operations or variations thereof can be performed in the embodiments of this application. Furthermore, the steps may be performed in different orders as presented in the above embodiments, and it is not necessary to perform all the operations in the above embodiments.
[0161] Based on the data synchronization method proposed in the embodiments of this application, the embodiments of this application also provide a distributed system, please refer to... Figure 1 The distributed system 100 includes: a load balancer 11, a database 12, a cluster management node 13, a first application node 14, and a second application node 15, wherein...
[0162] The first application node 14 is used to load the application data recorded in the database 12 into the first built-in storage space of the first application node 14.
[0163] The second application node 15 is used to load the application data recorded in the database 12 into the second built-in storage space of the second application node 15.
[0164] Load balancer 11 is used to receive data update requests for application data in database 12 sent by clients and send the data update requests to the first application node 14;
[0165] The first application node 14 is also used to update the application data recorded in the database 12 according to the data update request, and to notify the cluster management node 13 that the status of the database 12 is being updated.
[0166] The first application node 14 is also used to update the application data recorded in the database 12 that is in the updated state to the first built-in storage space when the cluster management node 13 records the database 12 in the updated state.
[0167] The second application node 15 is also used to update the application data recorded in the database 12 that is in the update state to the second built-in storage space when the cluster management node 13 records the database 12 in the update state.
[0168] In one implementation scenario, if a data update request carries data to be updated, the first application node 14 is specifically used to update the application data recorded in the database 12 to the data to be updated.
[0169] Furthermore, if the data update request also carries the location of the application data to be updated in database 12, the first application node 14 is specifically used to update the application data to be updated in the location of database 12 to the data to be updated.
[0170] In addition, in this embodiment of the application, the first application node 14 is also used to receive a first data query request from the client for the database 12 sent by the load balancer 11.
[0171] The first application node 14 is also used to query application data that matches the first data query request in the first built-in storage space and send the queried application data to the client.
[0172] In addition, the second application node 15 is also used to receive a second data query request from the client for the database 12 sent by the load balancer 11;
[0173] The second application node 15 is also used to query application data that matches the second data query request in the second built-in storage space, and send the queried application data to the client.
[0174] In a feasible implementation scenario, the distributed system also includes data nodes, with database 12 set up on the data nodes.
[0175] Based on the data synchronization method provided in the embodiments of this application, the embodiments of this application also provide another distributed system, for details see Figure 5 As shown, the distributed system 100 includes: a load balancer 11, a database 12, a first application node 14, and a second application node 15.
[0176] In a Figure 5 In the implementation scenario of the system shown, when the first application node 14 receives a data update request from the load balancer 11 for the application data of the database 12, the first application node 14 is also used to update the application data recorded in the database 12 according to the data update request. In addition, the first application node 14 is also used to send a notification message to other application nodes to notify other application nodes that the status of the database 12 is updated.
[0177] Or, in another way Figure 5 In the implementation scenario of the system shown, after the first application node 14 updates the application data recorded in the database 12 according to the data update request, the database 12 is used to: send a notification message that it is in the updated state to each application node.
[0178] This application embodiment also provides an application node (first application node 14), please refer to... Figure 6 The application node 600 has built-in storage space and includes:
[0179] Loading module 61 is used to load the application data recorded in database 12 into its own built-in storage space;
[0180] The receiving module 62 is used to receive data update requests from the load balancer 11 for application data of the database 12 from the client.
[0181] The update module 63 is used to update the application data recorded in the database 12 according to the data update request, and to notify the cluster management node 13 that the status of the database 12 is being updated.
[0182] The monitoring module 64 is used to update the application data recorded in the database 12 that is in the update state to the built-in storage space when the cluster management node 13 records the database 12 in the update state.
[0183] In one implementation process, if a data update request carries data to be updated, then update module 63 is specifically used to update the application data recorded in database 12 to the data to be updated.
[0184] Furthermore, if the data update request also carries the location of some application data that needs to be updated in the database 12, the update module 63 can also be specifically used to update the application data that needs to be updated in the location of the database 12 to the data to be updated.
[0185] In addition, the application node 600 may also include a query module. Figure 6 (Not shown), at this time,
[0186] The receiving module 62 is also used to receive the first data query request from the client for the database 12 sent by the load balancer 11;
[0187] This query module is used to query application data that matches the first data query request in the built-in storage space and send the queried application data to the client.
[0188] In addition, this application embodiment also provides an application node, please refer to... Figure 7 The application node 700 includes a processor 720 and a memory 710, the memory 710 storing an application program, and the processor 720 running the application program to execute the methods executed by the first application node 14 described above.
[0189] In addition, such as Figure 7 As shown, the application node 700 also includes a transceiver 730, which is used to communicate or transmit data with external devices.
[0190] This application embodiment also provides an application node (second application node 15), please refer to... Figure 8 The application node 800 has built-in storage space and includes:
[0191] Monitoring module 81 is used to monitor whether the status of the database 12 recorded by the cluster management node 13 is in an updated state;
[0192] If so, update module 82 is used to update the application data recorded in the database 12 that is in the update state to the built-in storage space.
[0193] In addition, the application node 800 may also include the following modules:
[0194] The receiving module 83 is used to receive data query requests from the client for the database 12 sent by the load balancer 11;
[0195] The query feedback module 84 is used to query application data that matches the data query request in the second built-in storage space and send the queried application data to the client.
[0196] In addition, in another implementation scenario, the receiving module 83 is also used to receive a data update request from the client for the application data of the database 12 sent by the load balancer 11.
[0197] At this time, the update module 82 is also used to update the application data recorded in the database 12 according to the data update request, and to notify the cluster management node 13 to record the status of the database 12 as being updated.
[0198] This application also provides an application node, please refer to... Figure 9 The application node 900 includes a processor 920 and a memory 910, the memory 910 storing an application program, and the processor 920 running the application program to execute the method executed on the side of the second application node 15 described above.
[0199] In addition, such as Figure 9 As shown, the application node 900 also includes a transceiver 930, which is used to communicate or transmit data with external devices.
[0200] The processor and transceiver described in this application can be implemented on integrated circuits (ICs), analog ICs, radio frequency integrated circuits (RFICs), mixed-signal ICs, application-specific integrated circuits (ASICs), printed circuit boards (PCBs), electronic devices, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal oxide semiconductors (CMOS), n-type metal-oxide-semiconductor (NMOS), p-type metal oxide semiconductors (PMOS), bipolar junction transistors (BJTs), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
[0201] The above should be understood Figure 6 , Figure 8The division of the various modules in the illustrated communication device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. These modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. For example, the update module can be a separate processing element, or it can be integrated into a chip in the communication device, such as a base station. Alternatively, it can be stored as a program in the communication device's memory, and its functions can be called and executed by a processing element of the communication device. The implementation of other modules is similar. Furthermore, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, the steps of the above method or the various modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0202] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented via a processing element scheduler, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling programs. Furthermore, these modules can be integrated together to form a system-on-a-chip (SOC).
[0203] The distributed system described in this application embodiment can be installed in a communication device.
[0204] Optionally, the communication device can be a standalone device or part of a larger device. For example, the device could be:
[0205] (1) Independent integrated circuit IC, or chip, or chip system or subsystem;
[0206] (2) A collection of one or more ICs, optionally including a storage component for storing data and / or instructions;
[0207] (3) ASIC, such as modem (MSM);
[0208] (4) Modules that can be embedded in other devices;
[0209] (5) Receivers, terminals, cellular phones, wireless devices, handheld devices, mobile units, network devices, etc.
[0210] (6) Others, etc.
[0211] Regardless of the method used, the above communication device includes at least one processing element, a storage element, and a communication interface, wherein at least one processing element is used to execute the method provided in the above method embodiments. The processing element can execute some or all of the steps in the above method embodiments in a first manner: that is, by executing a program stored in the storage element; or it can execute some or all of the steps in the above method embodiments in a second manner: that is, by combining instructions with integrated logic circuits in the hardware of the processing element; of course, the method provided in the above method embodiments can also be executed in combination with the first and second methods.
[0212] The processing element here, as described above, can be a general-purpose processor, such as a Central Processing Unit (CPU), or one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), etc. The storage element can be a single memory or a collective term for multiple storage elements.
[0213] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to execute the data synchronization method described in the above embodiments.
[0214] Furthermore, this application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to execute the data synchronization method described in the above embodiments.
[0215] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).
Claims
1. A data synchronization method, characterized in that, Applied to a distributed system, the distributed system further including a load balancer, a database, a cluster management node, a first application node, a second application node, and data nodes, the method includes: The first application node loads the application data recorded in the database into the first built-in storage space of the first application node; The second application node loads the application data recorded in the database into its second built-in storage space; wherein, the application data loaded into the built-in storage space by the first and second application nodes is related to the business that the application nodes need to process; The first application node receives a data update request from the client for application data in the database sent by the load balancer; wherein the load of the first application node is less than the load of the second application node; The data update request carries the location of the data to be updated and the partial application data to be updated in the database. The first application node updates the partial application data to be updated in the database location with the data to be updated, and notifies the cluster management node to record the status of the database as being in an update state; as a global status identifier to trigger data synchronization among application nodes in the distributed system. When the first application node detects that the cluster management node records the database as being updated, it updates the application data recorded in the database that is being updated to the first built-in storage space. When the second application node detects that the cluster management node has recorded the database as being updated, it updates the application data recorded in the database that is being updated to the second built-in storage space. The database is set up on the data node.
2. The method according to claim 1, characterized in that, The method further includes: The first application node receives a first data query request from the client for the database sent by the load balancer; The first application node queries the first built-in storage space for application data that matches the first data query request, and sends the queried application data to the client.
3. The method according to claim 1 or 2, characterized in that, The method further includes: The second application node receives a second data query request from the client for the database sent by the load balancer; The second application node queries the second built-in storage space for application data that matches the second data query request, and sends the queried application data to the client.
4. A data synchronization method, characterized in that, The method is applied to a first application node, which is located in a distributed system. The distributed system also includes a load balancer, a database, a cluster management node, a second application node, and data nodes. Application data recorded in the database is loaded into a first built-in storage space of the first application node and a second built-in storage space of the second application node, respectively. The method includes: The first application node loads the application data recorded in the database into the first built-in storage space; The first application node receives a data update request from the client for application data in the database sent by the load balancer; wherein the load of the first application node is less than the load of the second application node; The data update request carries the location of the data to be updated and the partial application data to be updated in the database. The first application node updates the partial application data to be updated in the database location with the data to be updated, and notifies the cluster management node to record the status of the database as being in an update state; as a global status identifier to trigger data synchronization among application nodes in the distributed system. When the first application node detects that the cluster management node records the database as being updated, it updates the application data recorded in the database that is being updated to the first built-in storage space. The database is set up on the data node.
5. The method according to claim 4, characterized in that, The method further includes: The first application node receives a first data query request from the client for the database sent by the load balancer; The first application node queries the first built-in storage space for application data that matches the first data query request, and sends the queried application data to the client.
6. A distributed system, characterized in that, The distributed system includes: a load balancer, a database, a cluster management node, a first application node, a second application node, and data nodes, wherein... The first application node is used to load the application data recorded in the database into the first built-in storage space of the first application node; The second application node is used to load the application data recorded in the database into the second built-in storage space of the second application node; wherein, the application data loaded into the built-in storage space of the first application node and the second application node is related to the business that the application node needs to process; The load balancer is configured to receive data update requests for application data in the database sent by the client, and send the data update requests to the first application node; wherein the load of the first application node is less than the load of the second application node; The first application node is also used to update the application data that needs to be updated at the location of the database to the data to be updated, and to notify the cluster management node to record the status of the database as being in an update state; so as to serve as a global status identifier that triggers data synchronization among application nodes in the distributed system. The data update request carries the location of the data to be updated and some application data that needs to be updated in the database; The first application node is also configured to update the application data of the database record in the updated state to the first built-in storage space when it is detected that the cluster management node records the database in the updated state. The second application node is also used to update the application data of the database record in the updated state to the second built-in storage space when the cluster management node records that the database is in the updated state. The database is set up on the data node.
7. The system according to claim 6, characterized in that, The first application node is also configured to receive a first data query request from the client for the database sent by the load balancer; The first application node is also configured to query application data that matches the first data query request in the first built-in storage space, and send the queried application data to the client.
8. The system according to claim 6 or 7, characterized in that, The second application node is also configured to receive a second data query request from the client for the database sent by the load balancer; The second application node is also used to query application data that matches the second data query request in the second built-in storage space, and send the queried application data to the client.
9. An application node, characterized in that, It includes a first application node and a second application node, wherein the application node is provided with built-in storage space, and the application node includes: A loading module is used to load application data recorded in the database into the built-in storage space; A receiving module is used to receive a data update request for application data of the database sent by a client from a load balancer; the data update request is sent to the first application node and received by the receiving module of the first application node, wherein the load of the first application node is less than the load of the second application node; The update module is used to update the application data that needs to be updated at the location of the database to the data to be updated, and to notify the cluster management node to record the status of the database as being in an update state; so as to serve as a global status identifier to trigger data synchronization among application nodes in the distributed system; the data update request carries the data to be updated and the location of the application data that needs to be updated in the database; The monitoring module is used to update the application data of the database records in the updated state to the built-in storage space when the cluster management node records that the database is in the updated state. The database is set up on the data node.
10. The application node according to claim 9, characterized in that, The application node also includes a query module. The receiving module is also configured to receive a first data query request from the client for the database sent by the load balancer; The query module is used to query application data that matches the first data query request in the built-in storage space, and send the queried application data to the client.
11. An application node, characterized in that, It includes a processor and a memory, the memory storing an application program, and the processor running the application program to perform the method of claim 4 or 5.
Citation Information
Patent Citations
Method and system for realizing data consistency
CN102411598A
Method for inquiring network data by client terminal based on cached data
CN103793485A
Resource state synchronization method and system in distributed system
CN107968808A
Refined Session cluster sharing system and method based on cache
CN108540556A
Method and apparatuses for handling storage of user data in 3G digital cellular telecommunication systems
CN101632078A
