Deterministic Query Replication for Database State Consistency

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improvequery flexibilityVSAvoidstate consistency
Core Design Contradiction:
Adaptability or versatilityVSReliability

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.

Inventive Principle:
Principle #1Segmentation

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.

Inventive Principle:
Principle #2Taking out (Extraction)

2Reliability

If deterministic query portions are used for replication, then state consistency between nodes is improved, but query capability and flexibility are reduced

Engineering Contradiction:
Improvestate consistencyVSAvoidquery capability
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

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.

Inventive Principle:
Principle #5Merging (Combining)

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.

Inventive Principle:
Principle #6Universality (Multi-functionality)

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

Engineering Contradiction:
Improvequery accuracyVSAvoidexecution time
Core Design Contradiction:
Measurement precisionVSLoss of time

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.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS10824641B1Deterministic query-based replication
Publication Date: 2020.11.03 AMAZON TECH INC
  • US10824641B1 patent drawing
  • US10824641B1 patent drawing
  • US10824641B1 patent drawing

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.