Lock Service Layer for Distributed Database Transaction Isolation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Distributed databases face challenges in supporting transactional access due to asynchronous responses, leading to errors such as duplicate transactions and data inconsistencies, as data operations across nodes can be executed out of order, causing issues like lost modifications, dirty reads, non-repeatable reads, and phantom reads.

Innovation Solution

A distributed database system with a lock service layer that partitions data and manages lock requests, ensuring that target data is locked only for the current transaction, blocking other transactions and operations from accessing it, thereby implementing atomicity and isolation through queue management and lock status monitoring.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If asynchronous database operations are performed in a distributed database, then access speed and parallelism are improved, but data consistency and transaction reliability deteriorate

Engineering Contradiction:
Improveaccess speedVSAvoiddata consistency
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent applies preliminary action by acquiring locks on target data before executing database operations. The lock acquisition happens in advance (before the actual data modification), ensuring that no other transaction can access or modify the same data during the critical section. This preliminary locking mechanism guarantees data consistency while allowing multiple transactions to proceed in parallel on different data, thus maintaining both reliability and productivity.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If lock requests are blocked and queued, then transaction isolation is improved, but processing time and system response delay increase

Engineering Contradiction:
Improvetransaction isolationVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies local quality by implementing fine-grained locking at the data level rather than using coarse-grained table or database locks. Each lock request targets specific target data (rows or columns), allowing different transactions to access different portions of the database simultaneously. This localized approach minimizes blocking and queuing delays while maintaining strong isolation guarantees for each transaction's specific data scope.

Inventive Principle:
Principle #3Local quality

3Adaptability or versatility

If data is partitioned and distributed across multiple nodes, then system scalability and storage capacity are improved, but transaction coordination complexity and communication overhead increase

Engineering Contradiction:
Improvesystem scalabilityVSAvoidtransaction coordination complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent applies segmentation by dividing the database into multiple partitions distributed across different nodes, with each partition independently manageable. The lock service layer segments lock requests into local lock acquisitions on each node, avoiding the need for centralized lock coordination across the entire distributed system. This segmentation reduces coordination complexity while maintaining scalability, as each node can process lock requests independently for its local partitions.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11243920B2Distributed database system, transaction processing method, lock server and storage medium
Publication Date: 2022.02.08 TENCENT TECHNOLOGY (SHENZHEN) CO LTD
  • US11243920B2 patent drawing
  • US11243920B2 patent drawing
  • US11243920B2 patent drawing

AI summary

A distributed database system may include storage layer. The storage layer may partition data and store the partitioned data in a distributed database. The system may further include access layer. The access layer may receive a transaction, identify target data corresponding to the transaction, and generate a lock request to lock the target data included in the partitioned data. The system may further include lock service layer. The lock service layer may identify, based on the lock request, a lock status for the target data according to a lock record for the target data. The lock service layer may lock, in response to the lock status being in an unlocked state, the target data. The lock service layer may block, in response to the lock status being in a locked state, the lock request and store the lock request in a queue.