Accounting system with high availability and consistency
The distributed FAS with leader-follower configuration and resilience mechanisms addresses availability and consistency issues in financial accounting systems, ensuring seamless transaction processing and data integrity across multiple nodes.
Patent Information
- Application Number
- PCT/CN2024/094162
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2025-11-27
AI Technical Summary
Distributed systems face challenges in maintaining high availability and strong consistency, particularly in financial accounting systems, due to issues like single points of failure, network disruptions, and unidirectional network failures, which affect transaction processing and data integrity.
A distributed Financial Accounting System (FAS) with a leader-follower configuration, employing leader election mechanisms, Federated Stateful Set (FSS), Advanced Disrupt Budget (ADB), and indirect communication paths to ensure seamless transaction processing and data integrity across multiple nodes, even in failure scenarios.
The FAS maintains high availability and strong consistency by ensuring data integrity and fault tolerance, allowing the system to handle increased transaction volumes without performance degradation and minimizing downtime through proactive monitoring and automated alerts.
Smart Images

Figure CN2024094162_27112025_PF_FP_ABST
Abstract
Description
ACCOUNTING SYSTEM WITH HIGH AVAILABILITY AND CONSISTENCYTECHNICAL FIELD
[0001] Embodiments of the present disclosure relate generally to an accounting system, and, more particularly, but not by way of limitation, to a distributed Financial Accounting System (FAS) with high availability and strong consistency.BACKGROUND
[0002] In the digital era, distributed systems have become a critical infrastructure for supporting modern applications. These systems provide resilient solutions with high performance and scalability by distributing computing and storage across multiple nodes. However, as the complexity of applications and user demands increase, distributed systems face increasingly severe challenges.
[0003] Some systems, such as accounting systems, require a high level of consistency among their distributed nodes (also referred to as “strong consistency” ) to ensure accuracy and reliability in transactions. Meanwhile, other systems, such as e-commerce websites and ticketing platforms, require high availability to manage the surge in customer activity during peak periods such as Black Friday and Singles’ Day.BRIEF DESCRIPTION OF THE DRAWINGS
[0004] In the drawings, which are not necessarily drawn to scale, like numerals may describe similar components in different views. To easily identify the discussion of any particular element or act, the most significant digit or digits in a reference number refer to the figure number in which that element is first introduced. Some embodiments are illustrated by way of examples, and not limitations, in the accompanying figures.
[0005] FIG. 1 is a block diagram showing an example data system, according to various embodiments of the present disclosure.
[0006] FIG. 2 is a block diagram illustrating an example centralized data system, according to various embodiments of the present disclosure.
[0007] FIG. 3 is a block diagram illustrating an example distributed data system, according to various embodiments of the present disclosure.
[0008] FIG. 4 is a block diagram illustrating an example distributed data system, that includes a plurality of nodes deployed in distributed data centers, according to various embodiments of the present disclosure.
[0009] FIG. 5A is a flowchart illustrating an example method for creating a distributed data system and processing received transaction data, according to various embodiments of the present disclosure.
[0010] FIG. 5B is a sequence diagram illustrating an example sequence for processing received transaction data in a distributed data system, according to various embodiments of the present disclosure.
[0011] FIG. 6 is a flowchart illustrating an example method for configurations of a distributed data system, according to various embodiments of the present disclosure.
[0012] FIGs. 7A-7B are diagrams illustrating a distributed data system in establishing an indirect connection between a client device and a leader node when the direct communication therebetween fails, according to various embodiments of the present disclosure.
[0013] FIGs. 8A-8B are diagrams illustrating a distributed data system in which a follower node can only communicate unidirectionally and requests for leader election, according to various embodiments of the present disclosure.
[0014] FIG. 8C is a diagram illustrating the distributed data system that employs a pre-election mechanism to eliminate incorrect leader elections, according to various embodiments of the present disclosure.
[0015] FIGs. 8D-8E are diagrams illustrating communication success rates before and after the pre-election mechanism is employed, according to various embodiments of the present disclosure.
[0016] FIG. 9A is a diagram illustrating a leader election process of the distributed data system, according to various embodiments of the present disclosure.
[0017] FIG. 9B is a diagram illustrating relationship between communication success rate and a leader election timeout threshold, according to various embodiments of the present disclosure.
[0018] FIG. 10 is a diagram illustrating the distributed data system in automatically copying a snapshot of local copy of transaction data stored in a follower node to another follower node, according to various embodiments of the present disclosure.
[0019] FIG. 11 is a block diagram illustrating a representative software architecture, which may be used in conjunction with various hardware architectures herein described, according to various embodiments of the present disclosure.
[0020] FIG. 12 is a block diagram illustrating components of a machine able to read instructions from a machine storage medium and perform any one or more of the methodologies discussed herein according to various embodiments of the present disclosure.DETAILED DESCRIPTION OF THE INVENTION
[0021] The description that follows includes systems, methods, techniques, instruction sequences, and computing machine program products that embody illustrative embodiments of the present disclosure. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of embodiments. It will be evident, however, to one skilled in the art that the present inventive subject matter may be practiced without these specific details.
[0022] Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present subject matter. Thus, the appearances of the phrase “in one embodiment” or “in an embodiment” appearing in various places throughout the specification are not necessarily all referring to the same embodiment.
[0023] For purposes of explanation, specific configurations and details are set forth in order to provide a thorough understanding of the present subject matter. However, it will be apparent to one of ordinary skill in the art that embodiments of the subject matter described may be practiced without the specific details presented herein, or in various combinations, as described herein. Furthermore, well-known features may be omitted or simplified in order not to obscure the described embodiments. Various embodiments may be given throughout this description. These are merely descriptions of specific embodiments. The scope or meaning of the claims is not limited to the embodiments given.
[0024] Various embodiments include systems, methods, and non-transitory computer-readable media that facilitate the implementation of a Financial Accounting System (FAS) optimized for distributed environments. The FAS is particularly designed to enhance the reliability and consistency of financial transactions across sectors such as e-commerce, where precise and timely processing of transaction data is essential.
[0025] The architecture of the FAS utilizes a distributed model to ensure data integrity and availability. As used herein, the term “data integrity” refers to the accuracy, consistency, and reliability of data stored within the system. It ensures that the data is correct, unaltered, and accessible only by authorized entities throughout its lifecycle. The term "availability" refers to the system's ability to remain operational and accessible, even in the face of hardware failures, network disruptions, or other unforeseen challenges. It ensures that the system's functionalities are always accessible to users when needed, thereby supporting continuous business operations.
[0026] By distributing transaction data across multiple nodes, the FAS maintains operational continuity even in scenarios of node failure or network disruptions. This distributed structure not only increases the system's fault tolerance but also supports scalability, allowing the system to handle increasing volumes of transactions without degradation in performance.
[0027] The FAS employs a leader-follower configuration, where leader nodes handle the initial processing and validation of transactions. These transactions are then propagated to follower nodes. This setup maintains strong consistency across the network, ensuring that all nodes synchronize based on the transaction logs managed by the leader. The FAS is equipped with automated leader election / leader pre-election mechanisms that ensure seamless transition and continuous function in the event the current leader node fails.
[0028] Additionally, the FAS employs a Federated Stateful Set (FSS) and an Advanced Disrupt Budget (ADB) to manage the deployment and operational resilience of nodes across multiple data centers. This configuration enhances the fault tolerance of the FAS by ensuring that a maximum number of nodes can be non-operational simultaneously without affecting the overall system performance.
[0029] Aspects of the present disclosure also include a monitoring and alerting tool that continuously assesses the health of the distributed network. This tool is capable of detecting anomalies and potential failures before they impact on the FAS’s operations. Automated alerts notify FAS administrators of issues that require attention, allowing for proactive maintenance and troubleshooting. This preemptive approach to system management helps in maintaining high availability and ensures that potential disruptions are managed swiftly and efficiently.
[0030] Furthermore, FAS includes a mechanism for establishing indirect connections between client devices and the leader node when direct communication fails. This feature enhances the FAS’s resilience by allowing follower nodes to act as intermediaries, forwarding requests from client devices to the leader node, ensuring that transactions can still be processed even if the direct path to the leader node is non-operational, thereby maintaining the system's availability and reliability during network disruptions.
[0031] Reference will now be made in detail to embodiments of the present disclosure, examples of which are illustrated in the appended drawings. The present disclosure may, however, be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein.
[0032] FIG. 1 is a block diagram showing an example data system 100 that includes a data management system 122 (also referred to as system 122) , according to various embodiments of the present disclosure. As shown, the data system100 includes one or more client devices 102, a server system 108, and a network 106 (e.g., Internet, wide-area-network (WAN) , local-area-network (LAN) , wireless network) that communicatively couples them together. Each client device 102 can host a number of applications, including a client software application 104. The client software application 104 can communicate data with the server system 108 via a network 106. Accordingly, the client software application 104 can communicate and exchange data with the server system108 via network 106.
[0033] The server system 108 provides server-side functionality via the network 106 to the client software application 104. While certain functions of the data system 100 are described herein as being performed by the data management system 122 on the server system 108, it will be appreciated that the location of certain functionality within the server system 108 is a design choice. For example, it may be technically preferable to initially deploy certain technology and functionality within the server system 108, but to later migrate this technology and functionality to the client software application 104.
[0034] The server system 108 supports various services and operations that are provided to the client software application 104 by the data management system 122. Such operations include transmitting data from the data management system 122 to the client software application 104, receiving data from the client software application 104 at the data management system 122, and the data management system 122 processing data generated by the client software application 104. Data exchanges within the data system 100 may be invoked and controlled through operations of software component environments available via one or more endpoints, or functions available via one or more user interfaces of the client software application 104, which may include web-based user interfaces provided by the server system 108 for presentation at the client device 102.
[0035] With respect to the server system 108, an Application Program Interface (API) server 110 and a web server 112 is coupled to an application server 116, which hosts the data management system 122. The application server 116 is communicatively coupled to a database server 118, which facilitates access to a database 120 that stores data associated with the application server 116, including data that may be generated or used by the data management system 122.
[0036] The API server 110 receives and transmits data (e.g., API calls, commands, requests, responses, and authentication data) between the client device 102 and the application server 116. Specifically, the API server 110 provides a set of interfaces (e.g., routines and protocols) that can be called or queried by the client software application 104 in order to invoke the functionality of the application server 116. The API server 110 exposes various functions supported by the application server 116 including, without limitation, user registration; login functionality; data object operations (e.g., generating, storing, retrieving, encrypting, decrypting, transferring, access rights, licensing) ; and / or user communications.
[0037] The server system 108, or the data management system 122 may extract user data from one or more third-party platforms (e.g., third-party social media platforms) . The extracted data may be open-source poster data associated with targeted influencers on the one or more third-party platforms 124 and may include user profile data, activity data, and media posted (either created and / or shared) by the one or more influencers. The media (or media data) include text, image, video, audio, and metadata. Example metadata may include hashtags and labels.
[0038] Through one or more web-based interfaces (e.g., web-based user interfaces) , the web server 112 can support various functionality of the data management system 122 of the application server 116.
[0039] It should be noted that the Financial Accounting System (FAS) described elsewhere in the present disclosure may refer to server system 108 or a part thereof. For example, the FAS may include the database 120, the database server 118, the data management system 122, or the like, or any combination thereof. In addition, the FAS can also be modified when necessary and such modifications are also within the protection scope of the present disclosure.
[0040] FIG. 2 is a block diagram illustrating an example centralized data system 200, according to various embodiments of the present disclosure.
[0041] As shown in FIG. 2, the centralized data system 200 may include a load balancer (e.g., the data management system 122) and a database 120. The data management system 122 is designed to efficiently distribute incoming transaction data across multiple processors within the Financial Accounting System (FAS) . The database 120 may include a balance and a journal. The balance reflects the real-time amount of currency in user accounts and the journal records the transaction history of the user accounts.
[0042] In some embodiments, a client device 102 may transmit transaction data to the data management system 122, detailing a financial transaction (e.g., A pays $100 to B) . This transaction leads to updates to the database 120 for both parties involved: A's balance should be decremented by $100 (A-100) , and B's balance should be incremented by $100 (B+100) . The data management system 122 may query the database 120 on the current balance of the parties and allocate the task of calculating the updates to the database 120 to multiple processors within the FAS system. This allocation may be based on current load, processor availability, and other operational parameters.
[0043] Once the calculations are completed, the results are sent to the database 120. The database 120 then updates the respective account balances and records the transaction in the journal. For instance, after processing the transaction, A's new balance might be recorded as 400, and B's new balance might be recorded as 600. Additionally, the journal entry would detail the transaction, noting the amounts debited and credited to A and B, respectively.
[0044] This centralized approach (also known as a stateless application) , while efficient in scenarios with manageable transaction volumes, can become a bottleneck during peak load times due to its reliance on a single point (the data management system 122) for distributing processing tasks. If a component in the centralized data system 200 fails, the centralized data system 200 no longer works. Also, the consistency or accuracy of data heavily relies on the database 120.
[0045] FIG. 3 is a block diagram illustrating an example distributed data system 300, according to various embodiments of the present disclosure. As shown in FIG. 3, the distributed data system 300 includes a Financial Accounting System (FAS) 302. The FAS 302 includes multiple nodes, exemplified by node 304. This system is designed to enhance reliability and scalability by distributing data and processing tasks across several nodes, each with a dedicated role.
[0046] The FAS 302 in this distributed data system300 operates as a stateful application, where each node 304 is interconnected and is consistent with each other. The client device 102 interacts with the distributed data system 300 by sending transaction data to the nodes. These nodes 304 process the data in a coordinated manner, ensuring that transactions are logged accurately in the FAS 302. The distributed nature of the system allows for enhanced data security and fault tolerance, as the impact of a single point of failure is significantly reduced.
[0047] This distributed approach not only provides high availability but also facilitates scalability, as additional nodes can be integrated into the system to handle increased load or to expand the system's capabilities. A dynamic leader election mechanism is employed to ensure that the distributed data system 300 continues to operate efficiently even if a leader node is removed or not working, making it highly adaptable to changing operational demands.
[0048] FIG. 4 is a block diagram illustrating an example distributed data system 400, that includes a plurality of nodes 408-416 deployed in distributed data centers 402-406 according to various embodiments of the present disclosure.
[0049] As depicted in FIG. 4, the distributed data system 400 (and the FAS system thereof) is structured to optimize data handling and transaction processing across geographically dispersed data centers, namely Data Center 1 (402) , Data Center 2 (404) , and Data Center 3 (406) . Each data center houses multiple nodes (408-416) that collectively work to manage and process transaction data efficiently.
[0050] A process begins when a client device 102 transmits transaction data to the FAS system 418. This transaction data is initially received by an elected leader node, which in this example is node 412 located in Data Center 2 (404) . The leader node 412 is responsible for coordinating the transaction processing across all nodes in the FAS system 418.
[0051] Upon receiving the transaction data, the leader node 408 performs a preliminary validation and processing operations. The leader node 408 replicates / forwards the transaction data to follower nodes within the same data center (node 414) and across other data centers (nodes 408 and 410 in Data Center 1 (402) and node 416 in Data Center 3 (406) ) . This replication ensures that the transaction data is consistently maintained across the system, enhancing data integrity and fault tolerance.
[0052] Each follower node, upon receiving the replicated data, performs its own set of processing operations. The processing operations may include additional validations, calculations, or storage, depending on the specific role assigned to each node. For instance, node 412 might handle specific calculations related to the transaction, while node 416 might focus on backup and recovery processes. In some embodiments, each of the nodes 408-416 is assigned with the same processing operations, e.g., updating the balances of A and B and recording transactions between them.
[0053] In some examples, the distributed data system400 includes three data centers: a first data center and a second data center each including two nodes and a third data center including a single node (also referred to as a 2-2-1 configuration) . This configuration ensures operational resilience and fault tolerance. Specifically, if any one of the data centers becomes non-operational due to maintenance issues or errors, the system 400 still retains a majority of its nodes active, ensuring the system 400's ability to reach consensus and maintain uninterrupted service.
[0054] Various other arrangements of nodes and data centers are possible, including but not limited to, a 3-3-1 configuration, a 4-4-1 configuration, a 2-2-2- configuration, a 1-1-1-1-1 configuration, etc. Such arrangements and alternative embodiments are all within the protection scope of the present disclosure. Each configuration offers distinct advantages and may be chosen based on specific needs such as the expected volume of transactions, geographical considerations, the criticality of maintaining high availability, or budget constraints. The flexibility in configuring the number and distribution of nodes across data centers allows the distributed data system 400 to be tailored to meet diverse operational demands and resilience requirements.
[0055] FIG. 5A is a flowchart illustrating an example method 500 for creating a distributed data system and processing received transaction data, according to various embodiments of the present disclosure. It will be understood that example methods described herein may be performed by a machine in accordance with some embodiments. For example, method 500 can be performed by the data management system 122, the server system 108, the FAS 302, the distributed data system 300, the distributed data system 400, the FAS 418, or individual components thereof. An operation of method 500 may be performed by one or more hardware processors (e.g., central processing units or graphics processing units) of a computing device (e.g., a desktop, server, laptop, mobile phone, tablet, etc. ) , which may be part of a computing system based on a cloud architecture. The method 500 may also be implemented in the form of executable instructions stored on a machine-readable medium or in the form of electronic circuitry. For instance, the operations of method 500 may be represented by executable instructions that, when executed by a processor of a computing device, cause the computing device to perform method 500. Depending on the embodiment, an operation of the method 500 may be repeated in different ways or involve intervening operations not shown. Though the operations of the method 500 may be depicted and described in a certain order, the order in which the operations are performed may vary among embodiments, including performing certain operations in parallel.
[0056] At operation 502, a processor deploys a plurality of nodes across multiple data centers. This deployment strategically positions the nodes to optimize data redundancy and ensure efficient data handling across geographically dispersed locations. The plurality of nodes may include a leader node and at least one follower node.
[0057] At operation 504, the leader node receives transaction data from a client device. The leader node acts as the primary coordinator for processing the transaction data across the distributed system. The transaction data may include details of a financial transaction, such as the parties involved and the amounts to be transferred.
[0058] At operation 506, the leader node updates stored first transaction data based on the received transaction data, e.g., calculating and updating real-time balances of user accounts, updating journals that records transaction histories, etc.
[0059] At operation 508, the leader node forwards the transaction data to the at least one follower nodes. The leader node forwards the transaction data to the at least one follower nodes to maintain data consistency and integrity across the system, as it ensures that all nodes have the same transaction data necessary for processing. It should be noted that the order of operations 506 and 508 may be switched. Order of other operations in the present disclosure can also be switched and is not limiting.
[0060] At operation 510, the at least one follower node may update second transaction data based on the transaction data received from the leader node.
[0061] FIG. 5B is a sequence diagram 524 illustrating an example sequence for processing received transaction data in a distributed data system, according to various embodiments of the present disclosure.
[0062] At operation 526, a client device transmits transaction data to the distributed data system, and specifically, to the leader node. The transaction data may include details of a financial transaction, such as the parties involved and the amounts to be transferred.
[0063] At operation 528, a leader node receives the transaction data from the client device.
[0064] At operation 530, the leader node forwards the received transaction data to a follower node.
[0065] At operations 532 and 534, based on receiving transaction data from the leader node, the follower node updates stored transaction data based on the received transaction data.
[0066] At operation 536, the leader node updates stored transaction data based on the received transaction data.
[0067] FIG. 6 is a flowchart illustrating an example method 600 for configurations of a distributed data system, according to various embodiments of the present disclosure. It will be understood that example methods described herein may be performed by a machine in accordance with some embodiments. For example, method 600 can be performed by the data management system 122, the server system 108, the FAS 302, the distributed data system 300, the distributed data system 400, the FAS 418, or individual components thereof. An operation the method 600 may be performed by one or more hardware processors (e.g., central processing units or graphics processing units) of a computing device (e.g., a desktop, server, laptop, mobile phone, tablet, etc. ) , which may be part of a computing system based on a cloud architecture. The method 600 may also be implemented in the form of executable instructions stored on a machine-readable medium or in the form of electronic circuitry. For instance, the operations of method 600 may be represented by executable instructions that, when executed by a processor of a computing device, cause the computing device to perform method 600. Depending on the embodiment, an operation of the method 600 may be repeated in different ways or involve intervening operations not shown. Though the operations of the method 600 may be depicted and described in a certain order, the order in which the operations are performed may vary among embodiments, including performing certain operations in parallel.
[0068] Consistent with some embodiments, the method 600 can be performed as part of the method 500 (e.g., subsequent to operation 502) , subsequent to the method 500, or in parallel with the method 500.
[0069] At operation 602, a processor configures a Federated Stateful Set (FSS) on the FAS system. This configuration causes nodes across the data centers to be treated as an integral group. This setup enhances the coordination and management of the nodes, ensuring that they operate cohesively despite being distributed across different locations.
[0070] At operation 604, a processor configures an Advanced Disrupt Budget (ADB) on the FAS system. The ADB limits the maximum number of nodes that can be non-operational simultaneously within the integral group. This configuration maintains system availability and resilience, as it ensures that the system can continue to function effectively even when some nodes are down. In some embodiments, the ADB may be configured on the FAS system after the FSS is configured on the FAS system such that the number of nodes that are operating / non-operating can be monitored across the integral group.
[0071] At operation 606, a processor may configure a health monitor on the FAS system. This health monitor is responsible for verifying whether the FAS system satisfies a preset operational condition. The conditions monitored may include, but are not limited to, whether the FAS system comprises a single operational leader node, whether the count of operational nodes in the system exceeds half of the total count of the plurality of nodes, whether the transactions per second (TPS) of the FAS system fall within a preset threshold range, or network traffic in the system falls within a preset threshold range.
[0072] Following the health monitoring, if the FAS system does not satisfy the preset operational condition, the processor generates an alert notification to a monitor device. This notification helps in quick identification and rectification of issues, thereby minimizing downtime and maintaining system performance.
[0073] Additionally, the processor may deploy a new node in existing data centers or a new data center in the FAS system. In such scenarios, the processor may further configure a life cycle hook on the system, which verifies whether the new node is synchronized with existing nodes. If the new node is not synchronized with the existing nodes, the processor takes steps to synchronize the new node with the leader node, ensuring consistency across the FAS system; otherwise, the new node is designated as / added to the FAS system as a follower node.
[0074] FIGs. 7A-7B are diagrams illustrating a distributed data system 700 in establishing an indirect connection between a client device 102 and a leader node 702 when the direct communication therebetween fails, according to various embodiments of the present disclosure.
[0075] In the depicted scenario, the leader node 702 is the primary receiver of requests from client devices 102 within the Financial Accounting System (FAS) 120. This central role makes the leader node a critical point, potentially becoming a Single Point of Failure (SPoF) . As illustrated in FIG. 7A, if a network issue arises that prevents a client device 102 from communicating directly with the leader node 702, the client device 102's requests cannot be processed directly, leading to potential system unavailability and request timeouts.
[0076] To address this vulnerability and enhance system resilience, FIG. 7B introduces a solution where follower nodes act as intermediaries. When the client device 102 cannot establish a direct connection with the leader node 702, it sends its request to one of the follower nodes, such as Follower1 704. This follower node then serves as a bridge by forwarding the client's request to the leader node 702.
[0077] Upon receiving the forwarded request from Follower1 704, the leader node 702 processes the request as it would a direct request from the client device 102. After processing, the leader node sends the response back to Follower1 704, which then relays this response back to the client device 102. This indirect communication path ensures that the client's requests are still processed by the leader node, maintaining the system's requirement for strong consistency where only the leader node handles transaction requests.
[0078] This bridging solution by the follower nodes not only resolves the issue of the leader node being a single point of failure but also significantly enhances the overall availability of the system. Each follower node is capable of acting as this bridge, thus distributing the potential load and reducing the risk of system unavailability due to isolated network issues affecting the leader node.
[0079] In some embodiments, the bridging solution is used only when a few client devices 102 cannot connect with the leader node 702 while most client devices 102 are connectable with the leader node 702. In scenarios where most or all the client devices 102 cannot connect with the leader node 702, a leader voting may be initiated to elect a new leader node and the original leader node 702 may be changed to a follower node.
[0080] In some embodiments, the FAS system 706 may periodically verify whether the direct connection between the client device 102 and the leader node 702 is resumed. If the direct connection is resumed, the FAS system 706 ceases the indirect communication through the follower node 704, and the client device 102 resumes its direct communication with the leader node 702.
[0081] FIGs. 8A-8B are diagrams illustrating a FAS 800 in which a follower node can only communicate unidirectionally and requests for leader election, according to various embodiments of the present disclosure.
[0082] A unique network failure known as a unidirectional network failure occurs when a node (e.g., follower 4, 802) can send requests to other nodes but cannot receive data or heartbeats from other nodes.
[0083] As illustrated in FIG. 8A, the leader node 804 is unable to synchronize data with Follower4 802 due to the unidirectional network issue. Despite this, Follower4 802 can still send requests to all other nodes. Due to the prolonged absence of data or heartbeats from the leader 804, Follower4 802 assumes that the leader 804 is no longer active and initiates a leader election request. FIG. 8B depicts that the cluster continuously undergoes leader elections (the original follower 3 806 becomes the leader but follower 4 802 requests a new round of leader election) because Follower4 does not receive data or heartbeats from the new leader either, thus repeatedly initiating leader election requests.
[0084] This continuous cycle of leader elections renders the cluster unstable and temporarily unavailable, affecting any requests made during the election periods. To address this issue, the system incorporates a pre-election mechanism. FIG. 8C is a diagram illustrating the distributed data system that employs a pre-election mechanism to eliminate incorrect leader elections, according to various embodiments of the present disclosure. The core idea of the pre-election mechanism is that before a node initiates an election, it first sends out a pre-election request to other nodes in the integral group (also referred to as cluster) . This preliminary step gauges the feasibility of a successful election without triggering the actual election process, thereby conserving system resources and maintaining stability.
[0085] In some examples, upon receiving a pre-election request, other nodes in the cluster will only agree to proceed with the election if two specific conditions are simultaneously met:
[0086] 1. there is currently no operational leader in the cluster.
[0087] 2.The log of the node initiating the pre-election request is as up-to-date as, or more current than, half of the nodes in the cluster.
[0088] This preliminary check ensures that only a node with a strong likelihood of being the most suitable new leader will proceed to the actual election phase. It prevents nodes with outdated information (e.g., nodes with unidirectional network failure) from disrupting the cluster's continuity and leadership stability. FIG. 8C illustrates the sequence of interactions initiated by Follower4 802 under the pre-election mechanism. Initially, Follower4 802, suspecting a failure in the leadership or being unaware of the current leader due to its unidirectional network issue, sends out a pre-election request to the other nodes in the cluster. The other nodes determine whether the two specific conditions are met. For example, Follower1 808 may determine that there is an operational leader 804 in the cluster and the log file stored in follower4 802 is too old (since it was not updated due to the unidirectional network failure) . Since more than all the nodes in the cluster have voted no, the leader election request of Follower4 802 is declined.
[0089] FIGs. 8D-8E are diagrams illustrating example communication success rates before and after the pre-election mechanism is employed, according to various embodiments of the present disclosure. As shown in the example of FIGs. 8D-8E, when a unidirectional network failure occurs, the communication success rate before the pre-election mechanism is employed dropped to 30% (TPS dropped from 150 to 40) and the communication success rate increased to 100%after the pre-election mechanism is employed (no noticeable drop in TPS when the unidirectional network failure 810 occurs.
[0090] FIG. 9A is a diagram illustrating a leader election process of the distributed data system, according to various embodiments of the present disclosure. The leader node (or referred to as a leader) in a cluster maintains its role through a heartbeat mechanism. The leader node regularly sends data to the follower nodes (or referred to as followers) , and even in the absence of actual data to transmit, it sends a request with an empty payload as a heartbeat. This continuous communication ensures that the follower nodes are aware of an active leader node.
[0091] However, if the leader node crashes or a network failure prevents the leader from sending data or heartbeats, the followers, after a period known as the Leader Election Timeout, will presume the leader is no longer alive. This triggers the followers to transition their roles to candidates and initiate an election request to all other nodes in the cluster. The right half 902 of FIG. 9A illustrates this election process. As shown in the left half 904 of FIG. 9A, if a client finds the current leader unreachable, it sends the request to the next node. If this node happens to be the new leader, it will directly execute the request. However, if it is not the leader, it will inform the client of the correct leader's information, and the client will retry sending the request to the correct leader. This mechanism effectively handles situations where the leader is unreachable, ensuring that requests are ultimately processed correctly. Understanding the leader election mechanism highlights the importance of configuring the Leader Election Timeout. If the Leader Election Timeout is too lengthy, followers will take a longer time to detect a leader's failure and initiate a new election, which prolongs the cluster's downtime. The leader needs time to send data to the followers, so the Leader Election Timeout should not be shorter than the time it takes for the leader to transmit data. Otherwise, followers might initiate a new election before the leader has finished transmitting data, leading to transmission failures. Therefore, the Leader Election Timeout is set such that it is long enough to detect a leader's failure, yet not so long that it causes unnecessarily excessive downtime.
[0092] FIG. 9B is a diagram illustrating an example relationship (exemplified as table 906 and curve plot 908) between communication success rate and a leader election timeout threshold, according to various embodiments of the present disclosure. As shown, shortening the Leader Election Timeout, reduces the duration of service unavailability during leader re-selection. This reduction can enhance the FAS system's responsiveness and reliability, minimizing the impact on operations during leader transitions. In some examples, the Leader Election Timeout duration is set to be a fixed value (or a randomized value) between 200ms and 400ms. However, it should be noted that the leader election timeout duration can be other values. All such variations of values are within the protection scope of the present disclosure.
[0093] In some examples, the FAS may require that all data written to disk must be encrypted, and the encryption keys are updated periodically. This requirement introduces certain challenges to the cluster's operation. After processing requests, the leader node encrypts the results and writes them to the local disk's log file, then sends the encrypted log file to the follower nodes. Upon receiving the data from the leader, the followers write it to their local disks, decrypt the data using the same key, and apply the decrypted data to their local state machines. This encryption process ensures data security but also necessitates careful management of encryption keys to maintain cluster functionality. The encryption keys may be stored in a third-party service and are updated periodically (every year, every month, every week, every day, etc. ) or when needed.
[0094] As an initial configuration, the FAS may access this third-party service only during node startup to retrieve the key, which was then stored in local memory for subsequent encryption tasks. However, issues arose when the key was updated from version v1 to v2, and the FAS cluster is restarting. For instance, if node 1 restarted and became the leader using the new key v2 for encryption, nodes 3, 4, and 5, which had not yet restarted, still held the old key v1 and thus could not decrypt the logs encrypted with v2, leading to cluster unavailability.
[0095] To address this, two solutions may be used: 1. requiring all followers restart first to fetch both v1 and v2 keys; and / or 2. dynamically retrieving key information regardless of node restart order.
[0096] FIG. 10 is a diagram illustrating the FAS 1000 in automatically copying a snapshot of local copy of data stored in a follower node to another follower node, according to various embodiments of the present disclosure. When a first follower is not up to date due to maintenance or errors, the leader may not be able to send transaction data directly to it. In such a case, a snapshot of local copy of transaction data or log file of a second follower node may be copied and forwarded to the second follower node.
[0097] FIG. 11 is a block diagram illustrating an example of a software architecture 1102 that may be installed on a machine, according to some example embodiments. FIG. 11 is merely a non-limiting example of a software architecture, and it will be appreciated that many other architectures may be implemented to facilitate the functionality described herein. The software architecture 1102 may be executing on hardware such as a machine 1200 of FIG. 12 that includes, among other things, processors 1210, memory 1230, and input / output (I / O) components 1250. A representative hardware layer 1104 is illustrated and can represent, for example, the machine 1200 of FIG. 12. The representative hardware layer 1104 comprises one or more processing units 1106 having associated executable instructions 1108. The executable instructions 1108 represent the executable instructions of the software architecture 1102. The hardware layer 1104 also includes memory or storage modules 1110, which also have the executable instructions 1108. The hardware layer 1104 may also comprise other hardware 1112, which represents any other hardware of the hardware layer 1104, such as the other hardware illustrated as part of the machine 1200.
[0098] In the example architecture of FIG. 11, the software architecture 1102 may be conceptualized as a stack of layers, where each layer provides particular functionality. For example, the software architecture 1102 may include layers such as an operating system 1114, libraries 1116, frameworks / middleware 1118, applications 1120, and a presentation layer 1144. Operationally, the applications 1120 or other components within the layers may invoke API calls 1124 through the software stack and receive a response, returned values, and so forth (illustrated as messages 1126) in response to the API calls 1124. The layers illustrated are representative in nature, and not all software architectures have all layers. For example, some mobile or special-purpose operating systems may not provide a frameworks / middleware 1118 layer, while others may provide such a layer. Other software architectures may include additional or different layers.
[0099] The operating system 1114 may manage hardware resources and provide common services. The operating system 1114 may include, for example, a kernel 1128, services 1130, and drivers 1132. The kernel 1128 may act as an abstraction layer between the hardware and the other software layers. For example, the kernel 1128 may be responsible for memory management, processor management (e.g., scheduling) , component management, networking, security settings, and so on. The services 1130 may provide other common services for the other software layers. The drivers 1132 may be responsible for controlling or interfacing with the underlying hardware. For instance, the drivers 1132 may include display drivers, camera drivers, drivers, flash memory drivers, serial communication drivers (e.g., Universal Serial Bus (USB) drivers) , drivers, audio drivers, power management drivers, and so forth depending on the hardware configuration.
[0100] The libraries 1116 may provide a common infrastructure that may be utilized by the applications 1120 and / or other components and / or layers. The libraries 1116 typically provide functionality that allows other software modules to perform tasks in an easier fashion than by interfacing directly with the underlying operating system 1114 functionality (e.g., kernel 1128, services 1130, or drivers 1132) . The libraries 1116 may include system libraries 1134 (e.g., C standard library) that may provide functions such as memory allocation functions, string manipulation functions, mathematic functions, and the like. In addition, the libraries 1116 may include API libraries 1136 such as media libraries (e.g., libraries to support presentation and manipulation of various media formats such as MPEG4, H. 264, MP3, AAC, AMR, JPG, and PNG) , graphics libraries (e.g., an OpenGL framework that may be used to render 2D and 3D graphic content on a display) , database libraries (e.g., SQLite that may provide various relational database functions) , web libraries (e.g., WebKit that may provide web browsing functionality) , and the like. The libraries 1116 may also include a wide variety of other libraries 1138 to provide many other APIs to the applications 1120 and other software components / modules.
[0101] The frameworks 1118 (also sometimes referred to as middleware) may provide a higher-level common infrastructure that may be utilized by the applications 1120 or other software components / modules. For example, the frameworks 1118 may provide various graphical user interface functions, high-level resource management, high-level location services, and so forth. The frameworks 1118 may provide a broad spectrum of other APIs that may be utilized by the applications 1120 and / or other software components / modules, some of which may be specific to a particular operating system or platform.
[0102] The applications 1120 include built-in applications 1140 and / or third-party applications 1142. Examples of representative built-in applications 1140 may include, but are not limited to, a home application, a contacts application, a browser application, a book reader application, a location application, a media application, a messaging application, or a game application.
[0103] The third-party applications 1142 may include any of the built-in applications 1140, as well as a broad assortment of other applications. In a specific example, the third-party applications 1142 (e.g., an application developed using the AndroidTM or iOSTM software development kit (SDK) by an entity other than the vendor of the particular platform) may be mobile software running on a mobile operating system such as iOSTM, AndroidTM, or other mobile operating systems. In this example, the third-party applications 1142 may invoke the API calls 1124 provided by the mobile operating system such as the operating system 1114 to facilitate functionality described herein.
[0104] The applications 1120 may utilize built-in operating system functions (e.g., kernel 1128, services 1130, or drivers 1132) , libraries (e.g., system libraries 1134, API libraries 1136, and other libraries 1138) , or frameworks / middleware 1118 to create user interfaces to interact with users of the system. Alternatively, or additionally, in some systems, interactions with a user may occur through a presentation layer, such as the presentation layer 1144. In these systems, the application / module “logic” can be separated from the aspects of the application / module that interact with the user.
[0105] Some software architectures utilize virtual machines. In the example of FIG. 11, this is illustrated by a virtual machine 1148. The virtual machine 1148 creates a software environment where applications / modules can execute as if they were executing on a hardware machine. The virtual machine 1148 is hosted by a host operating system (e.g., the operating system 1114) and typically, although not always, has a virtual machine monitor 1146, which manages the operation of the virtual machine 1148 as well as the interface with the host operating system (e.g., the operating system 1114) . A software architecture executes within the virtual machine 1148, such as an operating system 1150, libraries 1152, frameworks 1154, applications 1156, or a presentation layer 1158. These layers of software architecture executing within the virtual machine 1148 can be the same as corresponding layers previously described or may be different.
[0106] FIG. 12 illustrates a diagrammatic representation of a machine 1200 in the form of a computer system within which a set of instructions may be executed for causing the machine 1200 to perform any one or more of the methodologies discussed herein, according to an embodiment. Specifically, FIG. 12 shows a diagrammatic representation of the machine 1200 in the example form of a computer system, within which instructions 1216 (e.g., software, a program, an application, an applet, an app, or other executable code) for causing the machine 1200 to perform any one or more of the methodologies discussed herein may be executed. For example, the instructions 1216 may cause the machine 1200 to execute the method 500 described above with respect to FIG. 5A and the method 600 described above with respect to FIG. 6. The instructions 1216 transform the general, non-programmed machine 1200 into a particular machine 1200 programmed to carry out the described and illustrated functions in the manner described. In alternative embodiments, the machine 1200 operates as a standalone device or may be coupled (e.g., networked) to other machines. In a networked deployment, the machine 1200 may operate in the capacity of a server machine or a client machine in a server-client network environment, or as a peer machine in a peer-to-peer (or distributed) network environment. The machine 1200 may comprise, but not be limited to, a server computer, a client computer, a personal computer (PC) , a tablet computer, a laptop computer, a netbook, a personal digital assistant (PDA) , an entertainment media system, a cellular telephone, a smart phone, a mobile device, or any machine capable of executing the instructions 1216, sequentially or otherwise, that specify actions to be taken by the machine 1200. Further, while only a single machine 1200 is illustrated, the term “machine” shall also be taken to include a collection of machines 1200 that individually or jointly execute the instructions 1216 to perform any one or more of the methodologies discussed herein.
[0107] The machine 1200 may include processors 1210, memory 1230, and I / O components 1250, which may be configured to communicate with each other such as via a bus 1202. In an embodiment, the processors 1210 (e.g., a hardware processor, such as a central processing unit (CPU) , a reduced instruction set computing (RISC) processor, a complex instruction set computing (CISC) processor, a graphics processing unit (GPU) , a digital signal processor (DSP) , an application-specific integrated circuit (ASIC) , a radio-frequency integrated circuit (RFIC) , another processor, or any suitable combination thereof) may include, for example, a processor 1212 and a processor 1214 that may execute the instructions 1216. The term “processor” is intended to include multi-core processors that may comprise two or more independent processors (sometimes referred to as “cores” ) that may execute instructions contemporaneously. Although FIG. 12 shows multiple processors 1210, the machine 1200 may include a single processor with a single core, a single processor with multiple cores (e.g., a multi-core processor) , multiple processors with a single core, multiple processors with multiples cores, or any combination thereof.
[0108] The memory 1230 may include a main memory 1232, a static memory 1234, and a storage unit 1236 including machine-readable medium 1238, each accessible to the processors 1210 such as via the bus 1202. The main memory 1232, the static memory 1234, and the storage unit 1236 store the instructions 1216 embodying any one or more of the methodologies or functions described herein. The instructions 1216 may also reside, completely or partially, within the main memory 1232, within the static memory 1234, within the storage unit 1236, within at least one of the processors 1210 (e.g., within the processor’s cache memory) , or any suitable combination thereof, during execution thereof by the machine 1200.
[0109] The I / O components 1250 may include a wide variety of components to receive input, provide output, produce output, transmit information, exchange information, capture measurements, and so on. The specific I / O components 1250 that are included in a particular machine will depend on the type of machine. For example, portable machines such as mobile phones will likely include a touch input device or other such input mechanisms, while a headless server machine will likely not include such a touch input device. It will be appreciated that the I / O components 1250 may include many other components that are not shown in FIG. 12. The I / O components 1250 are grouped according to functionality merely for simplifying the following discussion, and the grouping is in no way limiting. In some examples, the I / O components 1250 may include output components 1252 and input components 1254. The output components 1252 may include visual components (e.g., a display such as a plasma display panel (PDP) , a light-emitting diode (LED) display, a liquid crystal display (LCD) , a projector, or a cathode ray tube (CRT) ) , acoustic components (e.g., speakers) , haptic components (e.g., a vibratory motor, resistance mechanisms) , other signal generators, and so forth. The input components 1254 may include alphanumeric input components (e.g., a keyboard, a touch screen configured to receive alphanumeric input, a photo-optical keyboard, or other alphanumeric input components) , point-based input components (e.g., a mouse, a touchpad, a trackball, a joystick, a motion sensor, or another pointing instrument) , tactile input components (e.g., a physical button, a touch screen that provides location and / or force of touches or touch gestures, or other tactile input components) , audio input components (e.g., a microphone) , and the like.
[0110] In further embodiments, the I / O components 1250 may include biometric components 1256, motion components 1258, environmental components 1260, or position components 1262, among a wide array of other components. The motion components 1258 may include acceleration sensor components (e.g., accelerometer) , gravitation sensor components, rotation sensor components (e.g., gyroscope) , and so forth. The environmental components 1260 may include, for example, illumination sensor components (e.g., photometer) , temperature sensor components (e.g., one or more thermometers that detect ambient temperature) , humidity sensor components, pressure sensor components (e.g., barometer) , acoustic sensor components (e.g., one or more microphones that detect background noise) , proximity sensor components (e.g., infrared sensors that detect nearby objects) , gas sensors (e.g., gas detection sensors to detect concentrations of hazardous gases for safety or to measure pollutants in the atmosphere) , or other components that may provide indications, measurements, or signals corresponding to a surrounding physical environment. The position components 1262 may include location sensor components (e.g., a Global Positioning System (GPS) receiver component) , altitude sensor components (e.g., altimeters or barometers that detect air pressure from which altitude may be derived) , orientation sensor components (e.g., magnetometers) , and the like.
[0111] Communication may be implemented using a wide variety of technologies. The I / O components 1250 may include communication components 1264 operable to couple the machine 1200 to a network 1280 or devices 1270 via a coupling 1282 and a coupling 1272, respectively. For example, the communication components 1264 may include a network interface component or another suitable device to interface with the network 1280. In further examples, the communication components 1264 may include wired communication components, wireless communication components, cellular communication components, near field communication (NFC) components, components (e.g., Low Energy) , components, and other communication components to provide communication via other modalities. The devices 1270 may be another machine or any of a wide variety of peripheral devices (e.g., a peripheral device coupled via a USB) .
[0112] Moreover, the communication components 1264 may detect identifiers or include components operable to detect identifiers. For example, the communication components 1264 may include radio frequency identification (RFID) tag reader components, NFC smart tag detection components, optical reader components (e.g., an optical sensor to detect one-dimensional bar codes such as Universal Product Code (UPC) bar code, multi-dimensional bar codes such as Quick Response (QR) code, Aztec code, Data Matrix, Dataglyph, MaxiCode, PDF417, Ultra Code, UCC RSS-2D bar code, and other optical codes) , or acoustic detection components (e.g., microphones to identify tagged audio signals) . In addition, a variety of information may be derived via the communication components 1264, such as location via Internet Protocol (IP) geolocation, location via signal triangulation, location via detecting an NFC beacon signal that may indicate a particular location, and so forth.
[0113] Certain embodiments are described herein as including logic or a number of components, modules, elements, or mechanisms. Such modules can constitute either software modules (e.g., code embodied on a machine-readable medium or in a transmission signal) or hardware modules. A “hardware module” is a tangible unit capable of performing certain operations and can be configured or arranged in a certain physical manner. In various example embodiments, one or more computer systems (e.g., a standalone computer system, a client computer system, or a server computer system) or one or more hardware modules of a computer system (e.g., a processor or a group of processors) are configured by software (e.g., an application or application portion) as a hardware module that operates to perform certain operations as described herein.
[0114] In some examples, a hardware module is implemented mechanically, electronically, or any suitable combination thereof. For example, a hardware module can include dedicated circuitry or logic that is permanently configured to perform certain operations. For example, a hardware module can be a special-purpose processor, such as a field-programmable gate array (FPGA) or an ASIC. A hardware module may also include programmable logic or circuitry that is temporarily configured by software to performcertain operations. For example, a hardware module can include software encompassed within a general-purpose processor or other programmable processor. It will be appreciated that the decision to implement a hardware module mechanically, in dedicated and permanently configured circuitry, or in temporarily configured circuitry (e.g., configured by software) can be driven by cost and time considerations.
[0115] Accordingly, the phrase “module” should be understood to encompass a tangible entity, be that an entity that is physically constructed, permanently configured (e.g., hardwired) , or temporarily configured (e.g., programmed) to operate in a certain manner or to perform certain operations described herein. Considering embodiments in which hardware modules are temporarily configured (e.g., programmed) , each of the hardware modules need not be configured or instantiated at any one instance in time. For example, where a hardware module comprises a general-purpose processor configured by software to become a special-purpose processor, the general-purpose processor may be configured as respectively different special-purpose processors (e.g., comprising different hardware modules) at different times. Software can accordingly configure a particular processor or processors, for example, to constitute a particular hardware module at one instance of time and to constitute a different hardware module at a different instance of time.
[0116] Hardware modules can provide information to, and receive information from, other hardware modules. Accordingly, the described hardware modules can be regarded as being communicatively coupled. Where multiple hardware modules exist contemporaneously, communications can be achieved through signal transmission (e.g., over appropriate circuits and buses) between or among two or more of the hardware modules. In embodiments in which multiple hardware modules are configured or instantiated at different times, communications between or among such hardware modules may be achieved, for example, through the storage and retrieval of information in memory structures to which the multiple hardware modules have access. For example, one hardware module performs an operation and stores the output of that operation in a memory device to which it is communicatively coupled. A further hardware module can then, at a later time, access the memory device to retrieve and process the stored output. Hardware modules can also initiate communications with input or output devices, and can operate on a resource (e.g., a collection of information) .
[0117] The various operations of example methods described herein can be performed, at least partially, by one or more processors that are temporarily configured (e.g., by software) or permanently configured to perform the relevant operations. Whether temporarily or permanently configured, such processors constitute processor-implemented modules that operate to perform one or more operations or functions described herein. As used herein, “processor-implemented module” refers to a hardware module implemented using one or more processors.
[0118] Similarly, the methods described herein can be at least partially processor-implemented, with a particular processor or processors being an example of hardware. For example, at least some of the operations of a method can be performed by one or more processors or processor-implemented modules. Moreover, the one or more processors may also operate to support performance of the relevant operations in a “cloud computing” environment or as a “software as a service” (SaaS) . For example, at least some of the operations may be performed by a group of computers (as examples of machines 1200 including processors 1210) , with these operations being accessible via a network (e.g., the Internet) and via one or more appropriate interfaces (e.g., an API) . In certain embodiments, for example, a client device may relay or operate in communication with cloud computing systems and may access circuit design information in a cloud environment.
[0119] The performance of certain of the operations may be distributed among the processors, not only residing within a single machine 1200, but deployed across a number of machines 1200. In some example embodiments, the processors 1210 or processor-implemented modules are located in a single geographic location (e.g., within a home environment, an office environment, or a server farm) . In other example embodiments, the processors or processor-implemented modules are distributed across a number of geographic locations.
[0120] The various memories (i.e., 1230, 1232, 1234, and / or the memory of the processor (s) 1210) and / or the storage unit 1236 may store one or more sets of instructions 1216 and data structures (e.g., software) embodying or utilized by any one or more of the methodologies or functions described herein. These instructions (e.g., the instructions 1216) , when executed by the processor (s) 1210, cause various operations to implement the disclosed embodiments.
[0121] As used herein, the terms “machine-storage medium, ” “device-storage medium, ” and “computer-storage medium” mean the same thing and may be used interchangeably. The terms refer to a single or multiple storage devices and / or media (e.g., a centralized or distributed database, and / or associated caches and servers) that store executable instructions 1216 and / or data. The terms shall accordingly be taken to include, but not be limited to, solid-state memories, and optical and magnetic media, including memory internal or external to processors. Specific examples of machine-storage media, computer-storage media and / or device-storage media include non-volatile memory, including by way of example semiconductor memory devices, e.g., erasable programmable read-only memory (EPROM) , electrically erasable programmable read-only memory (EEPROM) , FPGA, and flash memory devices; magnetic disks such as internal hard disks and removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The terms “machine-storage media, ” “computer-storage media, ” and “device-storage media” specifically exclude carrier waves, modulated data signals, and other such media, at least some of which are covered under the term “signal medium” discussed below.
[0122] In some examples, one or more portions of the network 1280 may be an ad hoc network, an intranet, an extranet, a virtual private network (VPN) , a LAN, a wireless LAN (WLAN) , a WAN, a wireless WAN (WWAN) , a metropolitan-area network (MAN) , the Internet, a portion of the Internet, a portion of the public switched telephone network (PSTN) , a plain old telephone service (POTS) network, a cellular telephone network, a wireless network, a network, another type of network, or a combination of two or more such networks. For example, the network 1280 or a portion of the network 1280 may include a wireless or cellular network, and the coupling 1282 may be a Code Division Multiple Access (CDMA) connection, a Global System for Mobile communications (GSM) connection, or another type of cellular or wireless coupling. In this example, the coupling 1282 may implement any of a variety of types of data transfer technology, such as Single Carrier Radio Transmission Technology (1xRTT) , Evolution-Data Optimized (EVDO) technology, General Packet Radio Service (GPRS) technology, Enhanced Data rates for GSM Evolution (EDGE) technology, third Generation Partnership Project (3GPP) including 3G, fourth generation wireless (4G) networks, Universal Mobile Telecommunications System (UMTS) , High-Speed Packet Access (HSPA) , Worldwide Interoperability for Microwave Access (WiMAX) , Long-Term Evolution (LTE) standard, others defined by various standard-setting organizations, other long-range protocols, or other data transfer technology.
[0123] The instructions may be transmitted or received over the network using a transmission medium via a network interface device (e.g., a network interface component included in the communication components) and utilizing any one of a number of well-known transfer protocols (e.g., hypertext transfer protocol (HTTP) ) . Similarly, the instructions may be transmitted or received using a transmission medium via the coupling (e.g., a peer-to-peer coupling) to the devices 1270. The terms “transmission medium” and “signal medium” mean the same thing and may be used interchangeably in this disclosure. The terms “transmission medium” and “signal medium” shall be taken to include any intangible medium that is capable of storing, encoding, or carrying the instructions for execution by the machine, and include digital or analog communications signals or other intangible media to facilitate communication of such software. Hence, the terms “transmission medium” and “signal medium” shall be taken to include any form of modulated data signal, carrier wave, and so forth. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal.
[0124] The terms “machine-readable medium, ” “computer-readable medium, ” and “device-readable medium” mean the same thing and may be used interchangeably in this disclosure. The terms are defined to include both machine-storage media and transmission media. Thus, the terms include both storage devices / media and carrier waves / modulated data signals. For instance, an embodiment described herein can be implemented using a non-transitory medium (e.g., a non-transitory computer-readable medium) .
[0125] Throughout this specification, plural instances may implement resources, components, operations, or structures described as a single instance. Although individual operations of one or more methods are illustrated and described as separate operations, one or more of the individual operations may be performed concurrently, and nothing requires that the operations be performed in the order illustrated. Structures and functionality presented as separate components in example configurations may be implemented as a combined structure or component. Similarly, structures and functionality presented as a single component may be implemented as separate components.
[0126] As used herein, the term “or” may be construed in either an inclusive or exclusive sense. The terms “a” or “an” should be read as meaning “at least one, ” “one or more, ” or the like. The presence of broadening words and phrases such as “one or more, ” “at least, ” “but not limited to, ” or other like phrases in some instances shall not be read to mean that the narrower case is intended or required in instances where such broadening phrases may be absent. Additionally, boundaries between various resources, operations, modules, engines, and data stores are somewhat arbitrary, and particular operations are illustrated in a context of specific illustrative configurations. Other allocations of functionality are envisioned and may fall within a scope of various embodiments of the present disclosure. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
[0127] It will be understood that changes and modifications may be made to the disclosed embodiments without departing from the scope of the present disclosure. These and other changes or modifications are intended to be included within the scope of the present disclosure.
[0128] Example 1. A system comprising: one or more hardware processors; and at least one machine-storage medium storing instructions that, when executed by the one or more hardware processors, cause the one or more hardware processors to perform operations comprising: deploying a plurality of nodes in at least two distributed data centers, the plurality of nodes comprising: a leader node in communication with a client device, the leader node locally storing first transaction data; and at least one follower node in communication with the leader node, the at least one follower node each locally storing second transaction data; receiving, at the leader node, transaction data from the client device; updating, at the leader node, the first transaction data based on the received transaction data; forwarding, by the leader node, the received transaction data to the at least one follower node; and updating, at the at least one follower node, the second transaction data based on the forwarded transaction data, the updating of the second transaction data stored in the at least one follower node causing the second transaction data to be synchronized with the first transaction data stored by the leader node.
[0129] Example 2. The system of example 1, wherein the at least two data centers include a first data center, a second data center, and a third data center, each of the first data center and the second data center comprising two nodes, the third data center including a single node.
[0130] Example 3. The system of any one of examples 1-2, wherein the at least one follower node and the leader node are each configured on separate racks within the at least two data centers.
[0131] Example 4. The system of any of one examples 1-3, wherein the operations further comprise: configuring a Federated Stateful Set (FSS) on the system, the FSS causing the leader node and the at least one follower node across the at least two data centers to be treated as an integral group.
[0132] Example 5. The system of any one of examples 1-4, wherein the operations further comprise: configuring an Advanced Disrupt Budget (ADB) on the system, the ADB limiting a maximum number of nodes that can be non-operational simultaneously in the integral group.
[0133] Example 6. The system of any one of examples 1-5, wherein the operations further comprise: configuring a health monitor on the system, the health monitor verifying whether the system satisfies a preset operational condition.
[0134] Example 7. The system of any one of examples 1-6, wherein the preset operational condition at least one of: the system comprises a single operational leader node; a count of operational nodes in the system exceeds half of a total count of the plurality of nodes; transactions per second (TPS) of the system falls within a preset threshold range; or network traffic in the system falls within a preset threshold range.
[0135] Example 8. The system of any one of examples 1-7, wherein the operations further comprise: in response to determining that the system does not satisfy the preset operational condition, generating an alert notification to a monitor device.
[0136] Example 9. The system of any one of examples 1-8, wherein the operations further comprise: deploying a new node in the at least two data centers or a new data center in the system; configuring a life cycle hook on the system, the life cycle hook verifying whether the new node is synchronized with existing nodes in the plurality of nodes; and in response to determining that the new node is synchronized with the leader node, adding the new node to the plurality of nodes as one of the at least one follower node.
[0137] Example 10. The system of any one of examples 1-9, wherein the operations further comprise: in response to determining that the newly deployed node is not synchronized with existing nodes, synchronizing the new node with the leader node.
[0138] Example 11. The system of any one of examples 1-10, wherein the operations further comprise: determining that the leader node cannot connect with the client device; and in response to determining that the leader node cannot connect with the client device, establishing a connection between the client device with one of the at least one follower node; and causing the one of the at least one follower node to relay the communication with the client device to the leader node.
[0139] Example 12. The system of any one of examples 1-11, wherein the operations further comprise: periodically verifying whether the connection between the client device and the leader node is resumed; and in response to determining that the connection between the client device and the leader node is resumed, ceasing the connection between the client device and the one of the at least one follower node; and causing the client device to directly communicate with the leader node.
[0140] Example 13. The system of any one of examples 1-12, wherein the operations further comprise: receiving, from a follower node, a request for a leader election; determining whether two pre-election conditions are satisfied, the two pre-election conditions comprise: the system does not comprise an operational leader node; and a log file stored in the follower node is not older than log files stored in at least half of the plurality of nodes in the system; and in response to determining that both pre-election conditions are satisfied, initiating the leader election.
[0141] Example 14. The system of any one of examples 1-13, wherein the initiating the leader vote comprises: designating the follower node as the leader node based on the follower node providing the request for leader election.
[0142] Example 15. The system of any one of examples 1-14, wherein the pre-election condition that the system does not comprise an operational leader node is determined by operations comprising: determining, at the at least one follower node, that no communication signals have been received from the leader node for a preset timeout duration, the preset timeout duration being between 200 ms and 400 ms.
[0143] Example 16. The system of any one of examples 1-15, wherein the operations further comprise: in response to determining that at least one of the pre-election conditions is not satisfied, declining the request for leader election.
[0144] Example 17. The system of any one of examples 1-16, wherein the follower node is configured to send communication signals to the leader node, wherein the follower node is not configured to receive communication signals from the leader node.
[0145] Example 18. The system of any one of examples 1-17, wherein the operations further comprise: creating a snapshot of a local copy of transaction data stored in a first follower node of the at least one follower node; determining that a second follower node is non-operational for a certain period; and copying the snapshot of the local copy of the transaction data stored in the first follower node into the second follower node after the second follower node is back to operation.
[0146] Example 19. A method comprising: deploying a plurality of nodes in at least two distributed data centers, the plurality of nodes comprising: a leader node in communication with a client device, the leader node locally storing first transaction data; and at least one follower node in communication with the leader node, the at least one follower node each locally storing second transaction data; receiving, at the leader node, transaction data from the client device; updating, at the leader node, the first transaction data based on the received transaction data; forwarding, by the leader node, the received transaction data to the at least one follower node; and updating, at the at least one follower node, the second transaction data based on the forwarded transaction data, the updating of the second transaction data stored in the at least one follower node causing the second transaction data to be synchronized with the first transaction data stored by the leader node.
[0147] Example 20. A machine-storage medium for storing instructions that, when executed by one or more hardware processors, cause the one or more hardware processors to perform operations comprising: deploying a plurality of nodes in at least two distributed data centers, the plurality of nodes comprising: a leader node in communication with a client device, the leader node locally storing first transaction data; and at least one follower node in communication with the leader node, the at least one follower node each locally storing second transaction data; receiving, at the leader node, transaction data from the client device; updating, at the leader node, the first transaction data based on the received transaction data; forwarding, by the leader node, the received transaction data to the at least one follower node; and updating, at the at least one follower node, the second transaction data based on the forwarded transaction data, the updating of the second transaction data stored in the at least one follower node causing the second transaction data to be synchronized with the first transaction data stored by the leader node.
Claims
1.A system comprising:one or more hardware processors; andat least one machine-storage medium storing instructions that, when executed by the one or more hardware processors, cause the one or more hardware processors to perform operations comprising:deploying a plurality of nodes in at least two distributed data centers, the plurality of nodes comprising:a leader node in communication with a client device, the leader node locally storing first transaction data; andat least one follower node in communication with the leader node, the at least one follower node each locally storing second transaction data;receiving, at the leader node, transaction data from the client device;updating, at the leader node, the first transaction data based on the received transaction data;forwarding, by the leader node, the received transaction data to the at least one follower node; andupdating, at the at least one follower node, the second transaction data based on the forwarded transaction data, the updating of the second transaction data stored in the at least one follower node causing the second transaction data to be synchronized with the first transaction data stored by the leader node.2.The system of claim 1, wherein the at least two data centers comprise a first data center, a second data center, and a third data center, each of the first data center and the second data center comprising two nodes, the third data center comprising a single node.3.The system of claim 1, wherein the at least one follower node and the leader node are each configured on separate racks within the at least two data centers.4.The system of claim 1, wherein the operations further comprise:configuring a Federated Stateful Set (FSS) on the system, the FSS causing the leader node and the at least one follower node across the at least two data centers to be treated as an integral group.5.The system of claim 4, wherein the operations further comprise:configuring an Advanced Disrupt Budget (ADB) on the system, the ADB limiting a maximum number of nodes that can be non-operational simultaneously in the integral group.6.The system of claim 1, wherein the operations further comprise:configuring a health monitor on the system, the health monitor verifying whether the system satisfies a preset operational condition.7.The system of claim 6, wherein the preset operational condition at least one of:the system comprises a single operational leader node;a count of operational nodes in the system exceeds half of a total count of the plurality of nodes;transactions per second (TPS) of the system falls within a preset threshold range; or network traffic in the system falls within a preset threshold range.8.The system of claim 6, wherein the operations further comprise:in response to determining that the system does not satisfy the preset operational condition, generating an alert notification to a monitor device.9.The system of claim 1, wherein the operations further comprise:deploying a new node in the at least two data centers or a new data center in the system;configuring a life cycle hook on the system, the life cycle hook verifying whether the new node is synchronized with existing nodes in the plurality of nodes; andin response to determining that the new node is synchronized with the leader node, adding the new node to the plurality of nodes as one of the at least one follower node.10.The system of claim 9, wherein the operations further comprise:in response to determining that the new node is not synchronized with existing nodes, synchronizing the new node with the leader node.11.The system of claim 1, wherein the operations further comprise:determining that the leader node cannot connect with the client device; and in response to determining that the leader node cannot connect with the client device,establishing a connection between the client device with one of the at least one follower node; andcausing the one of the at least one follower node to relay the communication with the client device to the leader node.12.The system of claim 11, wherein the operations further comprise:periodically verifying whether the connection between the client device and the leader node is resumed; andin response to determining that the connection between the client device and the leader node is resumed,ceasing the connection between the client device and the one of the at least one follower node; andcausing the client device to directly communicate with the leader node.13.The system of claim 1, wherein the operations further comprise:receiving, from a follower node, a request for a leader election;determining whether two pre-election conditions are satisfied, the two pre-election conditions comprise:the system does not comprise an operational leader node; anda log file stored in the follower node is not older than log files stored in at least half of the plurality of nodes in the system; andin response to determining that both pre-election conditions are satisfied, initiating the leader election.14.The system of claim 13, wherein the initiating the leader election comprises:designating the follower node as the leader node based on the follower node providing the request for leader election.15.The system of claim 13, wherein the pre-election condition that the system does not comprise an operational leader node is determined by operations comprising:determining, at the at least one follower node, that no communication signals have been received from the leader node for a preset timeout duration, the preset timeout duration being between 200 ms and 400 ms.16.The system of claim 13, wherein the operations further comprise:in response to determining that at least one of the pre-election conditions is not satisfied, declining the request for leader election.17.The system of claim 16, wherein the follower node is configured to send communication signals to the leader node, wherein the follower node is not configured to receive communication signals from the leader node.18.The system of claim 1, wherein the operations further comprise:creating a snapshot of a local copy of transaction data stored in a first follower node of the at least one follower node;determining that a second follower node is non-operational for a certain period; andcopying the snapshot of the local copy of the transaction data stored in the first follower node into the second follower node after the second follower node is back to operation.19.A method comprising:deploying a plurality of nodes in at least two distributed data centers, the plurality of nodes comprising:a leader node in communication with a client device, the leader node locally storing first transaction data; andat least one follower node in communication with the leader node, the at least one follower node each locally storing second transaction data;receiving, at the leader node, transaction data from the client device;updating, at the leader node, the first transaction data based on the received transaction data;forwarding, by the leader node, the received transaction data to the at least one follower node; andupdating, at the at least one follower node, the second transaction data based on the forwarded transaction data, the updating of the second transaction data stored in the at least one follower node causing the second transaction data to be synchronized with the first transaction data stored by the leader node.20.A machine-storage medium for storing instructions that, when executed by one or more hardware processors, cause the one or more hardware processors to perform operations comprising:deploying a plurality of nodes in at least two distributed data centers, the plurality of nodes comprising:a leader node in communication with a client device, the leader node locally storing first transaction data; andat least one follower node in communication with the leader node, the at least one follower node each locally storing second transaction data;receiving, at the leader node, transaction data from the client device;updating, at the leader node, the first transaction data based on the received transaction data;forwarding, by the leader node, the received transaction data to the at least one follower node; andupdating, at the at least one follower node, the second transaction data based on the forwarded transaction data, the updating of the second transaction data stored in the at least one follower node causing the second transaction data to be synchronized with the first transaction data stored by the leader node.
Citation Information
Patent Citations
Configuration synchronization method of distributed cluster nodes based on operation logs
CN108322533A
Block chain consensus method, consensus node and electronic equipment
CN113873030A
Distributed trust data storage system
US20200192888A1
Distributed system, message processing method, nodes, client, and storage medium
US20220091918A1
Systems and methods for range keys to enable efficient bulk writes in log-structured merge tree storage
US20240126738A1