Hybrid Logical Clock Transaction Processing Across Availability Zones

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Distributed databases face challenges in maintaining high-throughput and low-latency transactional loads due to network latency and clock skew issues when using multiple physical clocks across availability zones, leading to inconsistent transaction commits and reads.

Innovation Solution

Implementing a hybrid logical clock (HLC) system with centralized time services within each availability zone, using a two-phase commit protocol and applying a time delay based on clock skew to ensure consistent transaction processing across zones.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If multiple physical clocks are used in different availability zones, then high availability and distributed scalability are improved, but network latency and clock skew cause inconsistent transaction commits and reads

Engineering Contradiction:
Improvehigh availabilityVSAvoidtransaction commit consistency
Core Design Contradiction:
ReliabilityVSManufacturing precision

Solution Approach 1:

The system segments the distributed database into multiple availability zones, each with its own local clock, allowing independent operation and high availability while maintaining global consistency through the two-phase commit protocol

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a coordinator node as an intermediary that manages transactions across availability zones. The coordinator collects prepare timestamps from all zones, determines the maximum timestamp, and coordinates the commit process to ensure consistency despite clock skew between zones

Inventive Principle:
Principle #24Intermediary (Mediator)

2Manufacturing precision

If a single global clock is used, then transaction commit consistency is improved, but network latency increases for distant database instances

Engineering Contradiction:
Improvetransaction commit consistencyVSAvoidnetwork latency
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

Instead of using a single global clock, the system segments timekeeping into local clocks at each availability zone, allowing database instances to access local time without network latency while maintaining global consistency through coordinated commit protocols

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system performs preliminary actions by having all database instances prepare their transactions and record prepare timestamps before the actual commit. This preliminary preparation phase allows the coordinator to determine the commit timestamp based on the maximum prepare timestamp, ensuring consistency without requiring distant instances to wait for a global clock

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11436218B2Transaction processing for a database distributed across availability zones
Publication Date: 2022.09.06 CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
  • US11436218B2 patent drawing
  • US11436218B2 patent drawing
  • US11436218B2 patent drawing

AI summary

Transaction processing for a database distributed across availability zones is disclosed, including: determining that a transaction comprising a set of one or more statements is to be executed on a plurality of database servers across at least two availability zones, wherein each availability zone is associated with a respective hybrid logical clock (HLC)-based centralized time service; causing the set of one or more statements to execute on the plurality of database servers across the at least two availability zones; obtaining a plurality of HLC-based prepare timestamps from the plurality of database servers across the at least two availability zones; selecting a maximum HLC-based prepare timestamp to use as a commit timestamp associated with the transaction; and determining whether to return a commit result corresponding to the transaction after a time delay that is determined based at least in part on a predetermined time skew.