Log Read Thread for Low-Latency DBMS Replication

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database replication systems face challenges in maintaining predictable and constant latency during asynchronous log-based replication, particularly during periods of low or high activity, due to variable transaction sizes and inter-dependencies, which can lead to blocking issues and exceed maximum tolerable data staleness.

Innovation Solution

A system comprising a log read module, a log flush module, an update module, a reading module, and a notification module, which initializes a log read thread to read a predefined number of DBMS log records in a single API call, generates loggable transactions to unblock the log read thread if it times out, and notifies the log flush thread upon successful read completion, ensuring that the log read thread remains unblocked and continues reading log records.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the system waits for log records to be available before reading, then data accuracy is improved, but latency increases during low activity periods

Engineering Contradiction:
Improvedata accuracyVSAvoidlatency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs preliminary actions by initializing a log read thread that proactively monitors and reads log records before they are strictly needed. The thread is prepared in advance to read predefined numbers of log records, reducing the waiting time when logs are needed while maintaining data accuracy through controlled reading mechanisms.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The log read thread operates periodically, reading predefined numbers of log records at scheduled intervals rather than waiting continuously for data. This periodic operation maintains data accuracy by systematically processing logs while reducing latency by establishing predictable reading cycles that prevent indefinite blocking.

Inventive Principle:
Principle #19Periodic action

2Reliability

If the log read thread blocks until logs are available, then data completeness is improved, but system responsiveness deteriorates

Engineering Contradiction:
Improvedata completenessVSAvoidsystem responsiveness
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The system applies partial action by reading a predefined number of log records rather than waiting for complete transaction sets. This approach ensures sufficient data completeness for replication purposes while preventing the thread from blocking indefinitely, thus maintaining system responsiveness during low activity periods.

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The log read thread acts as an intermediary that mediates between the blocking log read API and the replication process. It buffers and processes log records in controlled batches, ensuring data completeness for replication while preventing direct blocking of the main system, thereby maintaining responsiveness.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If multiple log records are read in a single API call, then throughput is improved, but complexity of error handling increases

Engineering Contradiction:
ImprovethroughputVSAvoiderror handling complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system segments the log reading process into controlled batches by reading predefined numbers of log records in single API calls. Each batch is processed independently with its own error handling logic, which simplifies error management compared to handling large unsegmented batches while still improving throughput through batched operations.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system implements feedback mechanisms that monitor the success of batched log reads and adjust subsequent reading operations accordingly. When errors occur in batch processing, the feedback loop enables targeted error handling and recovery without compromising overall throughput, managing complexity through adaptive control.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS7890455B2System and apparatus to ensure a low-latency read of log records from a database management system (“DBMS”)
Publication Date: 2011.02.15 SAP SE
  • US7890455B2 patent drawing
  • US7890455B2 patent drawing
  • US7890455B2 patent drawing

AI summary

A system and method to ensure a low-latency read of log records from a Database Management System (“DBMS”) in asynchronous log-based database replication capture from a blocking log read Application Programming Interface (“API”). The system may include a replication server with a log read module to initialize a log read thread. The reading module of the log read thread may read a predefined number of DBMS log records. A log flush module of the log flush thread may be executed by the log read thread and waits for a read complete notification. The update module, in response to a log flush thread time out, may also generate a plurality of loggable transactions such that a number of log records in an internal API log satisfies a DBMS threshold and unblocks the DBMS API. Therefore, the latency time may be constant, low, and predictable ensuring an accurate replication capture.