Deterministic Query Replication for Database State Consistency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional database replication techniques face challenges due to non-deterministic queries, which can result in inconsistent states between master and destination nodes, even when starting from an equivalent initial state.
Innovation Solution
A system that identifies non-deterministic query portions and replaces them with deterministic equivalents, ensuring consistent results by forming and executing a new version of the query that can be replayed across nodes, maintaining equivalence in database states.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If non-deterministic queries are executed on destination nodes during replication, then query flexibility and real-world applicability are improved, but state consistency between master and destination nodes deteriorates
Solution Approach 1:
The query is segmented into deterministic and non-deterministic portions. The deterministic portion is executed on the destination node to ensure state consistency, while the non-deterministic portion is handled separately through log-based replication, allowing both consistency and flexibility to coexist.
Solution Approach 2:
The non-deterministic portion is extracted from the original query and handled through a different mechanism (log-based replication). This allows the deterministic core to maintain state consistency while the extracted non-deterministic elements preserve query flexibility.
2Reliability
If deterministic query portions are used for replication, then state consistency between nodes is improved, but query capability and flexibility are reduced
Solution Approach 1:
The patent merges two replication approaches: deterministic query execution for the deterministic portion and log-based replication for the non-deterministic portion. This combination maintains state consistency while preserving full query capability.
Solution Approach 2:
The replication system is designed to handle both deterministic and non-deterministic queries through a unified framework. The system can adapt its approach based on the query type, providing both consistency and flexibility through a single multi-functional solution.
3Measurement precision
If non-deterministic queries are replayed on destination nodes, then query accuracy is improved, but execution time and resource consumption increase due to re-processing
Solution Approach 1:
The deterministic portion of the query is executed preliminarily on the destination node before log-based replication. This preliminary execution ensures accurate state consistency, reducing the need for re-processing and thereby decreasing overall execution time.
Data Source
AI summary
A first database may receive a query comprising a first portion associated with a non-deterministic result. The first non-deterministic portion of the query may be mapped to a second deterministic portion. A second, deterministic query may be formed by replacing the first portion with the second portion. The second version of the query may be executed on the first database, causing the first database to transition from a first state to a second state. The second query may be executed on a second database in the first state, causing the second database to transition to a state equivalent to the second state of the first database.


