Transaction Log Buffering for Database Data Restoration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Asynchronous submission of transaction logs in database systems leads to poor durability and safety, causing permanent data loss and unreliability, especially in cluster databases where data crashes can result in incomplete log writes.
Innovation Solution
A method where transaction logs are saved to a buffer on the current node and backed up to a buffer on at least one backup node, with the logs being written to a disk transaction log file for restoration, ensuring data integrity and reliability by maintaining a consistent recording location across nodes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If asynchronous submission solution is used for transaction log, then concurrent conflict is reduced and productivity is improved, but data durability and reliability deteriorate causing permanent data loss
Solution Approach 1:
The patent applies preliminary action by recording the transaction log to the disk before allowing the transaction to be committed. The system writes the transaction log to a safe location on the disk, obtains a recording location, and only after this preliminary writing is complete does it allow the transaction to be marked as committed. This ensures that even with high concurrency, the data durability is maintained because the log is safely stored before the transaction becomes permanent.
2Reliability
If synchronous submission solution is used for transaction log, then data durability is improved, but concurrent conflict increases reducing productivity
Solution Approach 1:
The patent uses copying by creating a backup copy of the transaction log on the disk at a predetermined location before the transaction is fully committed. The system writes the transaction log content to the disk, obtains a recording location for this copy, and uses this copied log as the basis for data restoration. This copying mechanism allows multiple transactions to proceed concurrently while ensuring each has its log safely stored, thus improving both productivity and durability.
3Productivity
If transaction log is not completely written to disk before transaction submission, then productivity is improved, but data safety deteriorates causing permanent data loss
Solution Approach 1:
The patent applies preliminary anti-action by preemptively writing the transaction log to the disk and obtaining a recording location before the transaction submission is considered complete. This preliminary action counteracts the potential harm of data loss by ensuring the log is persisted to a reliable storage medium before the transaction is marked as committed, thus preventing permanent data loss while maintaining efficient transaction processing.
Data Source
AI summary
Embodiments of the present invention disclose a data restoration method, including: after a transaction is submitted, saving a generated transaction log to a buffer of a current node, and backing up the transaction log to a buffer of at least one backup node except the current node; writing the transaction log saved in the buffer of the current node or the transaction log backed up in the buffer of the backup node into a transaction log file in a disk, where the transaction log file in the disk is used for restoring data of the current node; and restoring, based on the transaction log file in the disk, lost data of the current node when a data loss event occurs in the current node. By means of the present invention, a risk of system data can be reduced, and durability, safety, and reliability of the system data can be improved.


