Versioned Insert-Only Hash Table for Concurrent In-Memory Access

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing hash table implementations in columnar in-memory data stores face challenges in supporting concurrent reader and writer access efficiently, leading to potential data corruption and performance issues when handling large datasets.

Innovation Solution

A versioned insert-only hash table design that uses a backing array with pointers to buckets, incorporating a modulo operation for hash function-based positioning, compare-and-swap techniques for atomic writes, and a semaphore mechanism to manage concurrent access, ensuring that writers can insert key-value pairs without overflows and maintain data integrity while allowing readers to access the hash table without deallocation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If a traditional hash table is used for concurrent access, then readers can access data, but writers may cause data corruption or performance degradation

Engineering Contradiction:
Improvedata integrityVSAvoidconcurrent access performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The hash table is segmented into multiple independent backing arrays, each serving as a separate version. Writers operate on one backing array while readers can access other backing arrays simultaneously, eliminating conflicts between concurrent reads and writes.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

A new backing array is allocated and prepared in advance before writers need to insert data. This preliminary allocation allows writers to start operations on the new array without waiting for the old array to be fully cleared, improving concurrency performance.

Inventive Principle:
Principle #10Preliminary action

2Quantity of substance

If the backing array size is increased to handle more key-value pairs, then write capacity improves, but memory consumption increases

Engineering Contradiction:
Improvekey-value pair capacityVSAvoidmemory usage
Core Design Contradiction:
Quantity of substanceVSWeight of stationary object

Solution Approach 1:

Old backing arrays are discarded after their data is migrated to new backing arrays. This allows memory to be recovered and reused, enabling the system to handle large quantities of key-value pairs over time without continuously increasing memory consumption.

Inventive Principle:
Principle #34Discarding and recovering

Solution Approach 2:

The system periodically creates new backing arrays and migrates data in batches rather than continuously growing a single large array. This periodic migration approach balances memory usage while maintaining capacity to handle increasing data volumes.

Inventive Principle:
Principle #19Periodic action

3Reliability

If a semaphore mechanism is implemented for writer synchronization, then data integrity is maintained, but write operation overhead increases

Engineering Contradiction:
Improveconcurrent write consistencyVSAvoidwrite operation latency
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

Instead of using complex synchronization mechanisms like semaphores, the system creates copies of the backing array (new versions) for each write operation. Writers independently modify their copy without blocking others, eliminating synchronization overhead while maintaining consistency through version management.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS10255309B2Versioned insert only hash table for in-memory columnar stores
Publication Date: 2019.04.09 SAP SE
  • US10255309B2 patent drawing
  • US10255309B2 patent drawing
  • US10255309B2 patent drawing

AI summary

At least one read operation is concurrently performed with at least one write operation that each insert a key/value pair into a backing array of a backing hash table of a hash table forming part of a columnar in-memory database. The backing array maps a plurality of pointers each to a respective bucket. Each bucket includes at least one state bit and a hashed value of a corresponding key. Thereafter, for each write operation, a first available position in the backing array at which a pointer to a new bucket containing the key/value pair can be inserted is iteratively determined (such that each first available position has no corresponding pre-existing pointer). Subsequently, for each write operation, the pointer to the new bucket containing the key/value pair is inserted at the corresponding first determined position in the backing array. Related apparatus, systems, techniques and articles are also described.