Introduction
Modern data-intensive systems are frequently hampered by the "I/O bottleneck." Databases rely on massive indexes, such as B-Trees or hash tables, to locate specific data. Even with high-speed NVMe SSDs, the standard retrieval process is inefficient: entire pages of index data must be loaded from the SSD into DRAM so the CPU can perform simple equality tests. This process wastes PCIe bandwidth, creates significant memory pressure leading to cache thrashing, and consumes CPU cycles on trivial bit-matching tasks.
The Search-in-Memory (SiM) architecture, presented at CODES+ISSS 2024, addresses these challenges by moving data matching directly into the NAND flash memory chips. By filtering data at the source, SiM reduces I/O traffic and energy consumption while significantly accelerating database workloads.
The Search-in-Memory (SiM) Architecture
SiM is a hardware-software co-design that enables Processing-in-Memory (PiM) within NAND flash with minimal area overhead.
Repurposing Existing Circuitry
Unlike previous PiM approaches that require complex processing elements, SiM leverages existing NAND components. It repurposes XOR gates and Failed Bit Counting (FBC) circuitry—originally used for error detection during programming—to perform parallel bitwise matching across an entire flash page.
SIMD Interface and Operations
SiM introduces a SIMD-like interface with two primary commands:
search: Compares a 64-bit query key (with an optional mask) against all data slots in a page simultaneously, returning a 512-bit match bitmap.gather: Uses the resulting bitmap to extract and transmit only the matching data chunks, significantly reducing the amount of data sent over the bus.
Hybrid Storage Model
The proposed architecture utilizes a hybrid storage model. A portion of the drive is dedicated to SLC (Single-Level Cell) mode for fast, reliable index searching (the "SiM Chip"), while the remainder uses TLC (Triple-Level Cell) mode for high-capacity data storage.
Optimistic Error Correction (OEC)
To maintain efficiency without the cost of a full on-chip ECC engine, SiM employs Optimistic Error Correction. It performs a rapid CRC check on a small header. If no errors are found—typical for SLC flash—it proceeds. If an error is detected, the system falls back to a standard full-page read handled by the SSD controller’s dedicated ECC chip.
Evaluation and Results
The researchers evaluated SiM using the Yahoo! Cloud Serving Benchmark (YCSB) on the Amber high-fidelity SSD emulator, testing various workload distributions ranging from uniform to highly skewed.
Key Performance Metrics
- Throughput: SiM achieved up to a 9x speedup in write-heavy workloads. By bypassing the OS page cache for index reads, it frees up DRAM to act as a write buffer.
- Energy Efficiency: Energy consumption was reduced by 10% to 45% due to the drastic reduction in data movement over the PCIe bus.
- Latency: Median read latency dropped by up to 89%, and tail latency (99th percentile) by up to 85%.
- Data Reduction: For random point queries, SiM can reduce PCIe bus transmission by 64x, sending only small result sets instead of full 8KB pages.
Discussion and Future Work
SiM's area overhead is estimated at only 3%, making it a commercially viable solution for accelerating data indexing. While highly effective for equality lookups and secondary indexes, current range query support requires a multi-pass approach. Future work will focus on native hardware support for range comparisons and the development of physical hardware prototypes for real-world database integration.
One observed limitation is in specific highly skewed workloads with infrequent reads, where tail latency can increase if the cache becomes saturated with "dirty" pages from writes. Addressing these corner cases remains an area for optimization.
Summary updated