Non-blocking Database Transactions via Synthetic Timestamps

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems face challenges in serving consistent, present-time reads while minimizing the effects of conflicting transactions, particularly between read and write operations, leading to increased latencies and inefficiencies.

Innovation Solution

The implementation of non-blocking transactions using synthetic timestamps, where a synthetic timestamp is generated based on a database node's time and duration, allowing write operations to be executed and acknowledged by replicas without blocking read transactions, enabling followers to serve reads before the write is fully committed.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If read transactions wait for write transactions to commit, then data consistency is maintained, but read latency increases

Engineering Contradiction:
Improvedata consistencyVSAvoidread latency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by having follower nodes pre-load and prepare data in advance before it is officially committed. Follower nodes replicate write operations locally and can serve reads from their prepared data, eliminating the need for read transactions to wait for formal commit while maintaining consistency through synthetic timestamp validation.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces synthetic timestamps as an intermediary mechanism to mediate between read and write transactions. These synthetic timestamps allow the system to determine whether a read can proceed without waiting for write commit, acting as a mediator that enables early reads while preserving consistency guarantees.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If follower nodes serve reads directly, then network traffic concentration at leaseholder node is reduced, but read consistency with present-time data is compromised

Engineering Contradiction:
Improveread transaction throughputVSAvoidread consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system changes the parameter of timestamp validation by introducing synthetic timestamps that differ from actual commit timestamps. This parameter change allows follower nodes to serve reads with present-time data by validating against synthetic timestamps rather than requiring formal commit confirmation, thus maintaining consistency while improving throughput.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If synthetic timestamps are used to enable early reads, then read-write concurrency is improved, but transaction latency management becomes more complex

Engineering Contradiction:
Improveread-write transaction concurrencyVSAvoidtransaction management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system implements self-service by having follower nodes autonomously generate and manage their own synthetic timestamps without requiring coordination with the leaseholder node. This self-service approach enables early reads at follower nodes while the leaseholder node continues to manage actual commits independently, improving concurrency without significantly increasing overall system complexity.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS20240070145A1Methods and systems for non-blocking transactions
Publication Date: 2024.02.29 COCKROACH LABS INC
  • US20240070145A1 patent drawing
  • US20240070145A1 patent drawing
  • US20240070145A1 patent drawing

AI summary

Methods and systems for executing non-blocking transactions at a database are provided. The method includes receiving a write transaction that is directed to a partition of a table stored by a cluster of database nodes. The method includes generating, at a database node of the cluster, a synthetic timestamp based on a first time associated with the database node and a duration, wherein the synthetic timestamp exceeds the first time by the duration. The method includes executing, based on determining the synthetic timestamp, one or more operations of the write transaction at one or more replicas of the partition. The method includes committing, based on a threshold number of acknowledgements, the one or more operations of the write transaction at the one or more replicas. The method includes sending, based on a second time exceeding the synthetic timestamp, an indication of success of the write transaction.