Master-Slave Switchover via Synchronization Time Monitoring
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data disaster tolerance solutions, such as master-master replication, face challenges in ensuring data consistency and usability due to the need for strict device distinction in the service layer, leading to potential primary key conflicts and complex implementation.
Innovation Solution
A data disaster tolerance method that monitors each node in a logic set, selects a slave node with the closest synchronization time point as a target node, and switches services to this node when the master node fails, ensuring data consistency and simplifying the implementation by avoiding the need for strict device distinction.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If master-master replication is used to enable automatic failover, then reliability is improved, but device complexity increases due to the need for strict device distinction in the service layer
Solution Approach 1:
The patent segments the system into a service layer and a data layer, allowing the service layer to treat all nodes uniformly while the data layer handles master-slave relationships. This segmentation resolves the contradiction by enabling automatic failover through master-master replication without requiring the service layer to implement complex device distinction logic.
Solution Approach 2:
The patent introduces an intermediary mechanism (the unified node access interface) that abstracts the underlying master-slave relationships from the service layer. This intermediary allows automatic failover to occur at the data layer while presenting a simple, uniform interface to the service layer, thereby resolving the contradiction between reliability and device complexity.
2Productivity
If master-master replication is implemented to achieve automatic switchover, then productivity is improved, but manufacturing precision deteriorates due to potential primary key conflicts
Solution Approach 1:
The patent applies local quality by allowing different nodes to have different roles (master or slave) dynamically assigned at the data layer, while the service layer maintains uniform access to all nodes. This enables rapid switchover by changing node roles without affecting service logic, while data consistency is maintained through controlled replication relationships at the local data layer.
Solution Approach 2:
The patent uses parameter changes by dynamically adjusting the master-slave relationship parameters at the data layer without changing the service layer configuration. When failover is needed, the system changes the operational parameters of nodes (promoting a slave to master) while maintaining data consistency through synchronized parameter updates across the replication group.
3Device complexity
If manual switchover is used in master-slave replication, then device complexity is reduced, but reliability deteriorates due to delayed failover response
Solution Approach 1:
The patent implements self-service by enabling the system to automatically detect master node failures and perform switchover without manual intervention. The service layer maintains simplicity by not implementing complex detection logic, while the data layer automatically monitors node health and executes failover, thereby achieving both reliability and simplicity.
Solution Approach 2:
The patent incorporates feedback mechanisms at the data layer where nodes continuously report their status to the replication management system. This feedback loop enables automatic detection of master node failures and triggers timely switchover to a slave node, achieving reliable automatic failover while keeping the service layer simple and unchanged.
Data Source
Figure 1a
Figure 1b~1c
Figure 2a
AI summary
The embodiments of the present application disclose a data disaster tolerance method, device and system. The method comprising: monitoring each node of multiple nodes in a logic set, the multiple nodes comprising a master node and a plurality of slave nodes; acquiring log information of a slave node when it is monitored that the master node is abnormal, the log information of the slave node comprising a time point when data is synchronized between the slave node and the master node; selecting a slave node having the time point closest to current time from the plurality of slave nodes as a target node; and updating the master node to be the target node. Thus, master-slave switchover is realized.