Database Transaction Management Using Commit Sequence Numbers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In database systems, the use of locks for concurrency control leads to lock conflicts and high network traffic, especially with a large number of concurrent transactions, which restricts concurrency and scalability.
Innovation Solution
Implementing a database system that uses a target commit sequence number (CSN) to distinguish between committed and active transactions, allowing the global transaction manager to maintain only a globally latest CSN, reducing the need for locks and network traffic by comparing CSNs to determine committed transactions, and enabling efficient query processing across multiple data nodes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a lock is used to obtain the active transaction linked list from the registered slot, then transaction consistency is ensured, but concurrency is greatly affected and lock conflicts occur
Solution Approach 1:
The patent extracts the active transaction linked list from the GTM's registered slot and moves it to the CN (coordinator node). The CN now maintains the active transaction linked list locally, eliminating the need for GTM to lock the registered slot when obtaining the transaction list. This extraction resolves the contradiction by allowing multiple CNs to access transaction lists simultaneously without lock conflicts, while still ensuring consistency through the coordinated distribution mechanism.
Solution Approach 2:
The CN acts as an intermediary between the GTM and the data nodes. Instead of the GTM directly managing and locking the active transaction linked list, the CN serves as a mediator that obtains the list from GTM and distributes it to relevant data nodes. This intermediary role eliminates the bottleneck at the GTM level and allows concurrent access without lock conflicts.
2Reliability
If the GTM manages all active transactions and generates an active transaction linked list, then transaction coordination is achieved, but network traffic increases and scalability is restricted
Solution Approach 1:
The patent segments the transaction management function by distributing the active transaction linked list to multiple CNs instead of having a single GTM manage all transactions centrally. Each CN maintains its own active transaction linked list for its managed transactions, reducing the network traffic required to distribute the complete list to all nodes. This segmentation allows transaction coordination to be maintained while significantly reducing network communication overhead.
Solution Approach 2:
Instead of the GTM generating and distributing a complete active transaction linked list containing all transactions to every node, the system performs partial action by having each CN maintain only the active transaction linked list relevant to its managed transactions. This partial maintenance approach reduces the quantity of data transmitted over the network while still achieving sufficient transaction coordination.
3Reliability
If a lock is used to access the active transaction linked list, then data integrity is protected, but calculation amount increases when searching through large quantities of active transactions
Solution Approach 1:
The patent extracts the active transaction linked list from the GTM's registered slot and places it at the CN level. This extraction allows the CN to maintain the list locally without requiring GTM to lock the registered slot, thereby reducing the calculation and locking overhead while preserving data integrity through the coordinated distribution mechanism.
Data Source
AI summary
A database system is provided, including a first global transaction manager (GTM), a first data node) DN, and a coordinator node (CN). The CN is configured to send a query to the first DN. The first DN is configured to, in response to the query, determine a target commit sequence number (CSN), determine a committed transaction on the first DN based on the target CSN, and determine a query result corresponding to the query based on the committed transaction. The target CSN is allocated by the first GTM. The target CSN is used to distinguish between the committed transaction and an active transaction on the first DN. The active transaction is a transaction that is being executed. In addition, a corresponding transaction management method is provided. The CSN is used to replace an active transaction linked list. This reduces network traffic and improves concurrency and scalability of the database system.


