Deterministic Database Transaction Serialization via Sequence Numbers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional concurrency control protocols in database systems exhibit nondeterministic behavior, leading to complications in database replication and horizontally scalable distributed databases due to the agnosticism of serialization order, which is dependent on various factors rather than the order of transaction entry.
Innovation Solution
Implementing a system with a data management architecture that identifies a logical serialization sequence for transactions, ensuring equivalent serial execution by ordering transactions in a batch and executing them in a manner that maintains deadlock freedom and equivalence to serial execution, using a preprocessor to generate batches of transactions and replicate them across database replicas.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional concurrency control protocols are used to allow parallel transaction execution, then system productivity is improved, but deterministic behavior is lost leading to nondeterministic execution order
Solution Approach 1:
The system performs preliminary actions by assigning sequence numbers to transactions before execution and pre-determining the serialization order. The preprocessor analyzes transactions and assigns them sequence numbers in advance, establishing a predetermined execution order that ensures deterministic behavior while allowing parallel execution of transactions with different sequence numbers.
2Reliability
If serialization order is determined by factors other than transaction entry order, then deadlock freedom is improved, but predictability and determinism are worsened
Solution Approach 1:
The system changes the parameter of serialization order from being dependent on various system factors to being determined by sequence numbers assigned to transactions. By introducing sequence numbers as a controlling parameter, the system achieves both deadlock freedom (through flexible ordering) and predictability (through deterministic sequence number assignment based on transaction entry time).
Data Source
AI summary
In an embodiment, a plurality of transactions for accessing a database may be acquired. The database may be associated with a plurality of locks. The plurality of transactions may include a first transaction, a second transaction, and a third transaction. A logical serialization sequence for executing the transactions may be identified. The logical serialization sequence may indicate that (1) the first transaction is to be executed before the second transaction based on all locks that are required by the first transaction being available; (2) the second transaction is to be executed after the first transaction has completed execution based on the second transaction requiring a lock that is required by the first transaction; and (3) the third transaction is to be executed before or during execution of the first transaction based on all locks required by the third transaction being different than the locks required by the first transaction.


