Lock-Free Indexing for Distributed Applications

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Distributed hashing-based applications face challenges in providing index-based operations that are both consistent and low-latency, especially in high-throughput environments with hundreds or thousands of storage servers and concurrent users, due to the lack of support for ACID properties and locking mechanisms in non-relational data stores.

Innovation Solution

A lock-free indexing algorithm is implemented using a tree-based index structure with deferred split operations, conditional writes, and index operation handlers to ensure immediate consistency and reduce insert latency without using locks, by embedding deferred split descriptors within index nodes and performing actual splits in separate operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locking mechanisms are used to ensure consistency in distributed hashing applications, then data consistency is improved, but insert latency and operation speed deteriorate due to lock acquisition and release overhead

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

Solution Approach 1:

The patent extracts the locking mechanism from the indexing operation entirely, replacing it with a lock-free data structure approach. The B-tree index operations are redesigned to use atomic compare-and-swap instructions instead of traditional locks, eliminating the time overhead associated with lock acquisition and release while maintaining consistency through atomic operations.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent replaces the mechanical locking system with a software-based atomic operation system. Instead of using hardware or software locks that require acquisition and release cycles, the system uses atomic compare-and-swap instructions at the instruction level, which are executed as single atomic operations by the processor, thereby eliminating lock overhead and reducing insert latency.

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

2Productivity

If non-relational data stores are used to achieve high throughput rates, then productivity is improved, but support for ACID properties and consistent transactions deteriorates

Engineering Contradiction:
Improvethroughput rateVSAvoidACID property support
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the transaction consistency problem into individual atomic operations at the index level. Each index operation is made atomic through compare-and-swap instructions, allowing the system to maintain ACID-like consistency for individual operations while preserving the high throughput characteristics of non-relational data stores. This segmentation enables consistency without requiring full transactional overhead.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the fundamental parameter of how consistency is achieved - moving from transaction-level consistency control (typical of relational databases) to operation-level atomicity through compare-and-swap instructions. This parameter change allows the system to maintain consistency for individual read and write operations while avoiding the overhead of full transaction management, thereby preserving high throughput.

Inventive Principle:
Principle #35Parameter changes

3Ease of operation

If traditional indexing structures are used in distributed environments, then ease of operation is improved, but scalability and performance deteriorate due to lock contention and coordination overhead

Engineering Contradiction:
Improveindex operation simplicityVSAvoidscalability
Core Design Contradiction:
Ease of operationVSProductivity

Solution Approach 1:

The patent introduces atomic compare-and-swap instructions as an intermediary mechanism between traditional indexing operations and the underlying distributed storage system. These atomic instructions serve as a mediator that enables simple index operations to be performed without lock contention, allowing the system to scale to thousands of concurrent users while maintaining operational simplicity through the use of standard B-tree structures enhanced with atomic operations.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS12019605B2Immediately-consistent lock-free indexing for distributed applications
Publication Date: 2024.06.25 AMAZON TECH INC
  • US12019605B2 patent drawing
  • US12019605B2 patent drawing
  • US12019605B2 patent drawing

AI summary

An index handler determines, with respect to a key to be inserted into an index, that a candidate destination node of the index meets a split criterion. The index handler generates and embeds a deferred split descriptor comprising an identifier of a new node within the destination node. Before an insert-completed indication is provided, the destination node is written to a back-end data store without acquiring a lock and without writing out the new node to the back-end data store. During the traversal of the index, the index handler identifies another deferred split descriptor indicating a second new node. After providing the indication that the key was successfully inserted, the index handler writes the second new node to the back-end data store.