High Availability Database System Using iSCSI and WAL
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current high availability database systems face data loss and inconsistency issues during failover due to sudden crashes or power outages, as data is not timely written to hard-disk drives, leading to irreparable chaos in the database.
Innovation Solution
The database system separates DBMS and DB using the iSCSI protocol for independent communication and employs DRBD mirroring and Write-Ahead-Logging to ensure data consistency and redundancy, with a master server assigning weights to slave servers for load balancing and failover, and utilizing 'keepalived' and 'ipvsadm' for automatic service redirection.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If data is stored in scratch pad memory first to improve operation performance, then system operation performance is improved, but data loss occurs when the system crashes or loses power
Solution Approach 1:
The patent implements a Write-Ahead-Logging (WAL) mechanism where data is first recorded in a log document file on the storage carrier before being written to the database. This preliminary action ensures that if a crash occurs, the data can be recovered from the log file, preventing data loss while maintaining the performance benefit of using scratch pad memory for active operations.
2Reliability
If a backup device is established to implement failover, then high availability is achieved, but data chaos occurs when the original backup device takes over without complete data
Solution Approach 1:
The system performs preliminary data preparation by writing data to a log document file on the storage carrier before failover occurs. This ensures that when the backup device takes over, it can retrieve complete and consistent data from the log file, preventing data chaos and ensuring data integrity during failover operations.
Solution Approach 2:
The patent implements DRBD (Distributed Replicated Block Device) mirroring to create a real-time copy of the storage carrier data. This copying mechanism ensures that the backup device has an up-to-date replica of the data, allowing for seamless failover without data loss or inconsistency.
3Device complexity
If DBMS and DB are integrated in a general database management system, then system simplicity is maintained, but data loss cannot be avoided during crashes
Solution Approach 1:
The patent separates the DBMS (Database Management System) from the DB (Database) into independent components. The DBMS runs on slave servers while the DB is stored on separate storage carriers. This segmentation allows the storage layer to implement independent data protection mechanisms like WAL and DRBD mirroring, ensuring data safety even during crashes while maintaining manageable system complexity through clear separation of concerns.
Data Source
AI summary
A database system includes a master server, a pair of slave servers and a main storage carrier. Each slave server is provided with a database management system (DBMS). The main storage carrier and the pair of slave servers uses the ISCSI protocol to make the pair of slave servers serving as the DBMS and the main storage carrier serving as a database (DB) connect and communicate to further make the DBMS and the DB independent and separate. The master server performs service assignment to the pair of slave servers according to a predetermined weight value. All connections of the database are directed to the slave server with a high weight value, and the other slave server with a low weight value serves as a standby.
