Latch-Free Log-Structured Storage for Database Systems

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current database systems face challenges in effectively utilizing recent hardware advancements such as multi-core processors and flash storage, leading to inefficiencies in data access and storage due to issues like latch conflicts, cache invalidations, and high overheads from partitioning and update-in-place methods.

Innovation Solution

The implementation of a latch-free, log-structured storage system, referred to as LLAMA, which uses a data opaque interface and compare-and-swap operations to manage page data storage, allowing for concurrent access and efficient flushing of pages between cache and secondary storage while minimizing cache invalidations and optimizing storage utilization.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If latch-free access is implemented for page data storage, then processor utilization and concurrency are improved, but ensuring data consistency and managing page states becomes more complex

Engineering Contradiction:
Improveprocessor utilizationVSAvoiddata consistency management
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent introduces a mapping table as an intermediary data structure that decouples the latch-free page access from the need for centralized locking. The mapping table stores page state information and locations without requiring latches, allowing multiple processors to access pages concurrently while maintaining consistency through the intermediary structure rather than direct resource locking.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces the traditional mechanical latch-based synchronization mechanism with a software-based compare-and-swap (CAS) operation on the mapping table. This substitution eliminates the need for hardware latches and their associated blocking behavior, enabling latch-free concurrent access while maintaining data consistency through atomic CAS operations that check and update page state information.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Loss of energy

If log-structured storage is used for secondary storage, then write amplification is reduced and storage efficiency is improved, but the complexity of managing flushed pages and their locations increases

Engineering Contradiction:
Improvewrite amplificationVSAvoidpage location management
Core Design Contradiction:
Loss of energyVSDevice complexity

Solution Approach 1:

The patent performs preliminary actions by pre-calculating and storing the secondary storage location of flushed pages in the mapping table before actual page access occurs. When a page is flushed to secondary storage, its new location is recorded in the mapping table entry, allowing subsequent accesses to directly retrieve the correct location without complex search or allocation algorithms, thus simplifying log-structured storage management.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent maintains a copy of page location information in the mapping table that parallels the physical page storage location. This copying mechanism allows the system to track page locations in software without requiring complex hardware management, enabling efficient retrieval of secondary storage locations while reducing write amplification through log-structured storage techniques.

Inventive Principle:
Principle #26Copying

3Reliability

If compare-and-swap operations are used for page state updates, then atomicity and consistency are improved, but the overhead of CAS operations and potential retry loops increases execution time

Engineering Contradiction:
Improvedata consistencyVSAvoidCAS operation overhead
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent applies partial action by using CAS operations selectively only when page state changes are needed, rather than continuously. The mapping table structure allows the system to perform CAS operations only at critical synchronization points, reducing the overall number of CAS executions and their associated overhead while maintaining atomicity and consistency where required.

Inventive Principle:
Principle #16Partial or excessive action

4Power

If multi-core processors and flash storage are utilized, then system performance potential is increased, but effective utilization becomes difficult due to existing system architecture limitations

Engineering Contradiction:
Improvesystem performanceVSAvoidarchitecture adaptation
Core Design Contradiction:
PowerVSDevice complexity

Solution Approach 1:

The patent creates a universal page access interface that works across multiple processors and storage types without requiring processor-specific or storage-specific optimizations. The latch-free mapping table approach and log-structured storage management provide a unified architecture that can effectively utilize multi-core processors and flash storage simultaneously, removing the need for separate optimization paths for different hardware platforms.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS11210220B2Log-structured storage for data access
Publication Date: 2021.12.28 MICROSOFT TECHNOLOGY LICENSING LLC
  • US11210220B2 patent drawing
  • US11210220B2 patent drawing
  • US11210220B2 patent drawing

AI summary

A data manager may include a data opaque interface configured to provide, to an arbitrarily selected page-oriented access method, interface access to page data storage that includes latch-free access to the page data storage. In another aspect, a swap operation may be initiated, of a portion of a first page in cache layer storage to a location in secondary storage, based on initiating a prepending of a partial swap delta record to a page state associated with the first page, the partial swap delta record including a main memory address indicating a storage location of a flush delta record that indicates a location in secondary storage of a missing part of the first page. In another aspect, a page manager may initiate a flush operation of a first page in cache layer storage to a location in secondary storage, based on atomic operations with flush delta records.