Database Read Routing via State Machine for Consistency

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The existing infrastructure for global databases and their clones experiences inconsistencies due to asynchronous updates, leading to potential side effects like 'undeleting' virtual machines, as reads from the global database and its clone may produce different results over time.

Innovation Solution

Implementing a state machine in each region to manage the state of projects, redirecting read requests to the global database at a specific timestamp when the clone is not up-to-date, and serving requests from the global clone once it is synchronized.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If data is replicated asynchronously from global database to global clone database, then replication speed is improved, but data consistency between global database and global clone database deteriorates

Engineering Contradiction:
Improvereplication speedVSAvoiddata consistency
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The system performs preliminary actions by recording the timestamp when the global clone database enters the pending state, and uses this timestamp to redirect read requests to the global database at the specific time point, ensuring data consistency before replication completes

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

A state machine is introduced as an intermediary component that tracks the replication state (ready or pending) and mediates read requests by redirecting them appropriately based on the current state, preventing inconsistent reads during asynchronous replication

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If read requests are served from global clone database, then read performance is improved, but risk of reading past version data increases

Engineering Contradiction:
Improveread performanceVSAvoiddata version accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The state machine provides feedback about the replication status (ready or pending state) to the read request handling logic, enabling dynamic routing decisions that prevent reading past version data while maintaining high read performance when safe

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The system preliminarily determines the replication state and records timestamps before serving read requests, using this pre-computed information to redirect requests to the correct data source at the correct time point, avoiding the need to check consistency at request time

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11995099B2System and method for switching from consistent database to an eventual consistent database replica in real time while preventing reads of past versions of the data
Publication Date: 2024.05.28 GOOGLE LLC
  • US11995099B2 patent drawing
  • US11995099B2 patent drawing
  • US11995099B2 patent drawing

AI summary

The present disclosure provides for consistent reads in a global database that is replicated to one or more global clones. A state machine is implemented, and executed independently, for each project in each region. Based on the state of a project when a read request is received, the read request will be served by the global database, served by the global clone, or ignored as an invalid request.