Distributed Transaction Concurrency Control via MVCC and Locking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing database systems face challenges in processing concurrent transactions in a distributed manner while ensuring safety and performance, particularly in avoiding deadlocks and starvation during OLTP operations.

Innovation Solution

The implementation of a concurrency control mechanism combining multi-version concurrency control for read operations (MVCC) and locking for write operations, along with a targeted isolation level that allows each transaction to execute against a different snapshot of the database, and write locks held until transaction commit.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If distributed transaction processing is implemented to improve system performance and scalability, then productivity and system capacity are improved, but the risk of deadlocks and starvation increases

Engineering Contradiction:
Improvetransaction processing capacityVSAvoidtransaction safety
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the distributed transaction system into multiple independent components: transaction coordinators that manage transaction lifecycles, resource managers that control access to specific data resources, and a centralized logging system. This segmentation allows transactions to be processed in parallel across different nodes while maintaining isolation, thereby improving productivity without compromising reliability through coordinated commit protocols

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces a centralized transaction log and coordination service as an intermediary between distributed transaction participants. This intermediary records all transaction operations, manages lock acquisition orders, and coordinates commit/rollback decisions across the distributed system, preventing deadlocks by ensuring consistent lock ordering and detecting cyclic wait conditions

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If strict transaction isolation is enforced to ensure data consistency, then reliability is improved, but system performance and throughput deteriorate

Engineering Contradiction:
Improvedata consistencyVSAvoidtransaction throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent implements periodic checkpointing and batch commit mechanisms where transactions are grouped and committed in phases rather than immediately upon completion. This allows the system to maintain strict isolation guarantees while improving throughput by reducing the frequency of synchronous commit operations and allowing asynchronous logging of transaction states

Inventive Principle:
Principle #19Periodic action

Solution Approach 2:

The patent extracts the heavy synchronization and locking overhead from the critical transaction execution path by implementing a two-phase commit protocol where the preparation phase can proceed with minimal locking, and only the final commit phase requires full coordination. This separates the consistency guarantee mechanism from the transaction processing path, maintaining reliability while improving productivity

Inventive Principle:
Principle #2Taking out (Extraction)

3Reliability

If concurrency control mechanisms are implemented to prevent deadlocks, then transaction safety is improved, but system complexity increases

Engineering Contradiction:
Improvetransaction safetyVSAvoidsystem architecture complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent implements automatic deadlock detection and resolution mechanisms where the transaction coordinator autonomously monitors lock acquisition patterns, detects cyclic wait conditions, and automatically aborts victim transactions to break deadlocks. This self-service approach to deadlock management improves reliability without requiring manual intervention or significantly increasing operational complexity

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent implements preliminary lock ordering and resource allocation planning where transactions declare their intended resource access patterns in advance, and the coordinator pre-establishes a global lock ordering scheme. This preliminary action prevents deadlocks by ensuring all transactions acquire locks in a consistent order, eliminating cyclic wait conditions before they can occur

Inventive Principle:
Principle #10Preliminary action

4Reliability

If distributed locking is used to manage concurrent access, then data integrity is improved, but transaction latency increases

Engineering Contradiction:
Improvedata integrityVSAvoidtransaction latency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent implements dynamic lock duration adjustment where lock hold times are adapted based on transaction characteristics, resource contention levels, and system load conditions. Short-lived transactions release locks quickly, while long-running transactions use coarser-grained locking strategies, optimizing the balance between data integrity and transaction latency dynamically rather than using fixed locking durations

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS12235833B2Distributed execution of transactional queries
Publication Date: 2025.02.25 SNOWFLAKE INC
  • US12235833B2 patent drawing
  • US12235833B2 patent drawing
  • US12235833B2 patent drawing

AI summary

The subject technology receives, at a first execution node, a first transaction, the first transaction to be executed on linearizable storage. The subject technology determines whether the first execution node corresponds to a rank indicating a leader worker. The subject technology, in response to the first execution node corresponding to the rank indicating the leader worker, performs, by the first execution node, an initialization process for executing the first transaction. The subject technology broadcasts a first read timestamp associated with the first transaction to a set of execution nodes, the set of execution nodes being different than the first execution node. The subject technology executes, by the first execution node, at least a first operation from the first transaction.