Snapshot Delay Measurement for Database Load Balancing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Database systems face challenges in maintaining continuous availability and load balancing during high workloads, as replication delays between primary and secondary databases can lead to outdated data and inefficient resource allocation, affecting the secondary database's ability to support the primary system effectively.

Innovation Solution

A method is implemented to measure and manage the snapshot delay between a primary and secondary database system by replicating transactions and generating a snapshot delay value based on timestamps, allowing for selective routing of client statements and ensuring that the secondary database remains near-currently synchronized with the primary database.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the secondary database replicates transactions from the primary database, then data consistency is maintained, but replication delay increases causing outdated data

Engineering Contradiction:
Improvedata consistencyVSAvoidreplication delay
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies preliminary action by proactively measuring and monitoring the snapshot delay between primary and secondary databases before it causes problems. The system continuously tracks the time difference between when a transaction is committed in the primary database and when it becomes visible in the secondary database, allowing for proactive load balancing decisions rather than reactive responses to data inconsistency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent implements feedback mechanisms by measuring the actual snapshot delay and using this information to dynamically adjust load balancing decisions. The system receives feedback about the replication state from the secondary database and uses this to determine whether to route queries to the primary or secondary database, creating a closed-loop control system that adapts to changing replication conditions.

Inventive Principle:
Principle #23Feedback

2Reliability

If the secondary database is kept fully synchronized with the primary database, then data availability is improved, but system resources are wasted

Engineering Contradiction:
Improvedata availabilityVSAvoidsystem resources
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent applies partial action by maintaining the secondary database only to the extent necessary for load balancing purposes, rather than keeping it fully synchronized. The system uses selective synchronization where data is replicated only when needed for query routing decisions, and the secondary database is used for queries where snapshot delay is within acceptable thresholds, optimizing resource utilization.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent changes the parameter of synchronization from complete to partial by introducing a configurable snapshot delay threshold. Instead of maintaining full synchronization, the system adjusts the level of synchronization based on operational needs, allowing queries to be routed to the secondary database when the snapshot delay is within acceptable parameters, thereby reducing unnecessary resource consumption.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If load balancing is implemented between primary and secondary databases, then throughput is improved, but data inconsistency occurs

Engineering Contradiction:
ImprovethroughputVSAvoiddata consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent applies dynamics by making the load balancing strategy adaptive rather than static. The system dynamically adjusts query routing based on real-time snapshot delay measurements, switching between primary and secondary databases according to their current replication state. This dynamic approach allows the system to maintain data consistency while optimizing throughput by routing queries to the most appropriate database at any given moment.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent uses feedback from snapshot delay measurements to control load balancing decisions. The system continuously monitors the replication lag and uses this feedback to determine whether to route queries to the primary or secondary database, ensuring that load balancing actions are based on actual data consistency conditions rather than fixed rules, thereby maintaining reliability while improving productivity.

Inventive Principle:
Principle #23Feedback

4Reliability

If the secondary database is used for all queries, then system availability is improved, but query accuracy decreases due to snapshot delay

Engineering Contradiction:
Improvesystem availabilityVSAvoidquery accuracy
Core Design Contradiction:
ReliabilityVSMeasurement precision

Solution Approach 1:

The patent applies dynamics by making query routing adaptive based on snapshot delay conditions. Instead of statically directing all queries to the secondary database, the system dynamically adjusts routing decisions based on the current replication state, routing queries to the secondary database only when snapshot delay is within acceptable thresholds and routing to the primary database when delay exceeds thresholds, thereby maintaining both availability and accuracy.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the parameter of query routing from fixed to flexible by introducing snapshot delay as a controlling factor. The system uses configurable delay thresholds to determine when it is safe to route queries to the secondary database, allowing for fine-tuned control over the trade-off between availability and accuracy based on operational requirements and data freshness needs.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS11379323B2Measuring snapshot delay between source database and its asynchronous replica
Publication Date: 2022.07.05 SAP SE
  • US11379323B2 patent drawing
  • US11379323B2 patent drawing
  • US11379323B2 patent drawing

AI summary

A computer implemented method is provided for determining a delay between a first database and an associated replicated database by replicating transactions of the first database in the replicated database, determining a delay between the two databases based on a commit timestamp from the first database and a timestamp associated with the commit transaction becoming visible in the replicated database. Then, after a predefined period of time has elapsed since replicating the commit transaction, determining a second delay based on a timestamp associated with a heartbeat log and a replicated database system time. And, selectively determining to execute or deny a statement received by the replicated database based on the second delay. Related apparatus, systems, techniques and articles are also described.