Multi-Tiered Latch System for Database Sequence Cache Contention
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In modern database systems, sequence cache latch contention leads to significant waiting times as multiple users contend for access to sequence numbers, especially in systems with a large number of concurrent users and transactions, where the waiting time can exceed processing time.
Innovation Solution
Implementing a multi-tiered latch system, with a global latch for serializing access to a master list of sequences and separate slave latches for each allocated sequence, reducing contention by allowing concurrent access to multiple sequences while maintaining serialization through a master latch.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If a single global latch is used to serialize access to the master list of sequences, then sequence number uniqueness is guaranteed, but waiting time increases significantly as the number of concurrent users increases
Solution Approach 1:
The patent divides the single global latch into multiple slave latches, each associated with a specific sequence cache. This segmentation allows multiple users to access different sequences concurrently without contending for the same latch, thereby reducing waiting time while maintaining sequence uniqueness through the coordinating global latch.
Solution Approach 2:
The patent introduces sequence caches as intermediary structures between users and the master list. These caches hold pre-allocated sequence numbers, allowing users to retrieve sequences without directly accessing the master list, thus reducing latch contention and waiting time while maintaining data integrity.
2Loss of time
If multiple slave latches are introduced to reduce contention, then waiting time decreases, but system complexity increases
Solution Approach 1:
The global latch serves multiple functions: it coordinates access to the master list, manages sequence cache allocations, and ensures overall system consistency. This multi-functionality reduces the need for additional complex coordination mechanisms despite the introduction of multiple slave latches.
Solution Approach 2:
The patent adds a hierarchical dimension to the latch system, with a global latch operating at one level and multiple slave latches operating at another level. This dimensional organization allows concurrent access at the slave latch level while maintaining centralized coordination at the global latch level, managing complexity through structured hierarchy.
Data Source
AI summary
In a database system having a plurality of concurrently executing session processes, the method commences by establishing a master list of sequences, the master list comprising a plurality of sequence objects which in turn define a sequence of values used for numbering and other identification within the database system. To reduce sequence cache latch access contention, multiple tiers of latches are provided. Methods of the system provide a first tier having a first tier “global” latch to serialize access to the master list. A second tier of latches is provided, the second tier having multiple second tier latches to serialize access to corresponding allocated sequences of values such that at any point in time, only one of the concurrently executing session processes is granted access to the allocated sequence.


