TCAM-SSD: A Framework for Search-Based Computing in Solid-State Drives

Ryan Wong, Nikita Kim, Kevin Higgs, Sapan Agarwal, Engin İpek, Saugata Ghose, Ben Feinberg · DOI

TL;DR

TCAM-SSD is a novel framework that transforms standard NAND flash arrays into high-speed search engines by treating them as Ternary Content-Addressable Memory (TCAM). By performing parallel searches directly inside the storage device, it eliminates massive data movement bottlenecks, delivering up to a 17.7x speedup for database analytics and significant gains for transactional and graph workloads.

What Problem Does This Paper Address?

Modern computing is hitting a "data movement wall." As datasets grow to petabyte scales, moving data from storage (SSD) to the CPU for processing consumes the vast majority of a system's time and energy. While Processing-in-Memory (PIM) aims to fix this by moving logic closer to data, most existing solutions are either too expensive (DRAM-based PIM) or require radical, impractical changes to NAND flash hardware.

Furthermore, search is a fundamental operation in almost every big-data application—from database indexing to graph traversal. Traditional systems rely on complex software structures like B-trees or hash tables to avoid scanning entire disks, but these structures themselves become bottlenecks when they no longer fit in the system's main memory (DRAM).

Methods

The authors propose TCAM-SSD, which leverages the inherent physical structure of NAND flash to perform "bulk" associative searches.

The Core Primitive: In-Memory Search (IMS)

In a standard NAND array, data is usually read row-by-row. TCAM-SSD flips this: it stores data "vertically" along bitlines. By applying specific voltages ($V_{read}$ and $V_{pass}$) to all wordlines simultaneously, the flash array can act as a TCAM. It can search for a specific bit pattern (0, 1, or "don't care" X) across thousands of entries in a single cycle. If a bitline matches the search key, current flows through it; if not, it remains off.

Architectural Innovations

  1. Hybrid Partitioning: The framework logically partitions the SSD into "search regions" (where data is stored vertically for fast searching) and "standard regions" (for normal I/O). A "Link Table" in the firmware keeps these regions synchronized.
  2. Firmware Search Manager: A new module in the Flash Translation Layer (FTL) that handles the mapping between search results and the actual data records.
  3. NVMe 2.0 Interface: The authors designed a programmer-friendly API that extends the NVMe protocol. This allows developers to call Search() or Append() directly from their code, much like interacting with a Key-Value store.
  4. Hardware Optimizations: They introduce "Early Termination" to skip processing blocks with zero matches and "Write Inversion" to speed up the programming of the transposed search data.

Datasets

The researchers evaluated TCAM-SSD across three major domains using industry-standard benchmarks:

  • Transactional Databases (OLTP): Evaluated using TPC-C traces via the DBx1000 simulator.
  • Database Analytics (OLAP): Evaluated using TPC-H queries (specifically modified versions of Q1 and Q2).
  • Graph Analytics: A diverse suite of 10 real-world and synthetic graphs, including Twitter, Patents, LiveJournal, and the massive MAG240M (121M nodes, 1.3B edges).

Key Insights and Ideas

  • NAND is a Natural Searcher: The most striking insight is that NAND flash is physically better suited for TCAM operations than standard reads. Because search operations use lower average wordline voltages, they actually induce 1300x fewer read-disturb errors than conventional reads, potentially increasing the drive's reliability.
  • The "Index in Storage" Strategy: Instead of trying to fit a massive database index into expensive host DRAM, TCAM-SSD treats the storage itself as the index. This effectively provides "infinite" index capacity at the cost of very cheap NAND flash.
  • Associative Update Mode: The framework supports a mode where the CPU sends an operation (e.g., "increment salary for all employees named Bob") and the SSD performs the search and the update entirely internally, never sending the matching records back to the host.

Key Results

  • Database Analytics: TCAM-SSD achieved an average 17.7x speedup for analytical queries compared to a conventional system. In some high-sparsity scenarios, speedups reached over 100x.
  • Transactional Databases: For OLTP workloads where the index exceeds DRAM size, the framework provided a 60.9% speedup and reduced data movement between the SSD and CPU by 92.3%.
  • Graph Processing: By using a compressed index structure, TCAM-SSD sped up Single-Source Shortest Path (SSSP) algorithms by 14.5% on larger-than-memory datasets while reducing the in-memory metadata footprint by 47.5%.

Limitations and Future Work

  • SLC Density Penalty: To ensure reliability and speed, search regions currently require the flash to operate in SLC (Single-Level Cell) mode. While this reduces storage density for those specific blocks, the authors note that search regions typically occupy less than 2% of the total drive capacity.
  • Update Overhead: Because data is stored in a transposed (vertical) format, updating a single record is more "expensive" than in a standard row-major layout. This makes TCAM-SSD most effective for datasets that are read-heavy or appended to, rather than frequently modified in place.
  • Hardware Adoption: While the modifications are "lightweight" (adding 2:1 muxes to the peripheral circuitry), they still require NAND manufacturers to alter their physical die designs, which is a significant hurdle for commercial adoption.

Summary updated

Abstract

As the amount of data produced in society continues to grow at an exponential rate, modern applications are incurring significant performance and energy penalties due to high data movement between the CPU and memory/storage. While processing in main memory can alleviate these penalties, it is becoming increasingly difficult to keep large datasets entirely in main memory. This has led to a recent push for in-storage computation, where processing is performed inside the storage device. We propose TCAM-SSD, a new framework for search-based computation inside the NAND flash memory arrays of a conventional solid-state drive (SSD), which requires lightweight modifications to only the array periphery and firmware. TCAM-SSD introduces a search manager and link table, which can logically partition the NAND flash memory's contents into search-enabled regions and standard storage regions. Together, these light firmware changes enable TCAM-SSD to seamlessly handle block I/O operations, in addition to new search operations, thereby reducing end-to-end execution time and total data movement. We provide an NVMe-compatible interface that provides programmers with the ability to dynamically allocate data on and make use of TCAM-SSD, allowing the system to be leveraged by a wide variety of applications. We evaluate three example use cases of TCAM-SSD to demonstrate its benefits. For transactional databases, TCAM-SSD can mitigate the performance penalties for applications with large datasets, achieving a 60.9% speedup over a conventional system that retrieves data from the SSD and computes using the CPU. For database analytics, TCAM-SSD provides an average speedup of 17.7x over a conventional system for a collection of analytical queries. For graph analytics, we combine TCAM-SSD's associative search with a sparse data structure, speeding up graph computing for larger-than-memory datasets by 14.5%.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
TPC-C · OLTP workloadTCAM-SSDworkload speedup60.9%Oltp Workload · transactions=1 million · search-region=single warehouse · table-entries=3 million · baseline-index=LastName hash index
Source quote
L704: We observe that over the course of the workload, TCAM-SSD achieves a speedup of \urevRW{60.9%} over DBx1000.
TPC-H · database analytics (Query 1 and Query 2TCAM-SSDaverage scan speedup across analytical queries17.7×Database Analytics · queries=Query 1 and Query 2 · scale-factor=100 · scan-table-size=74 GB
Source quote
L22: For database analytics, TCAM-SSD \tSG{provides} an average speedup of \urevRW{17.7}× over a conventional system for a collection of analytical queries.
TPC-H · database analytics, Query 1TCAM-SSDscan speedup18.3×Database Analytics · query=Query 1 · scale-factor=100 · scan-table-size=74 GB
Source quote
L755: For the database that we generate, TCAM-SSD \tRW{on average} speeds up the scan operation for Query~1 by \urevRW{18.3}×, and Query~2 by \urevRW{17.1}×,
TPC-H · database analytics, Query 2TCAM-SSDscan speedup17.1×Database Analytics · query=Query 2 · optimization=fused-key · scale-factor=100 · scan-table-size=74 GB
Source quote
L755: For the database that we generate, TCAM-SSD \tRW{on average} speeds up the scan operation for Query~1 by \urevRW{18.3}×, and Query~2 by \urevRW{17.1}×,
SSSP · vertex traversals, average across evaluated networksTCAM-SSD (TCAM-256)performance improvement14.5%Graph Traversal · variant=TCAM-256 · locality=0% · comparison=OOM · index-access-assumption=every access is a DRAM row miss
Source quote
L902: \tSG{Fourth, because TCAM-256 uses our optimized data structure, it} can further improve the performance for large graphs with vertices with high degrees with an average improvement of {14.5}% and {4.3}% over OOM and TCAM (NP), respectively.
SSSP · vertex traversals, average across evaluated networksTCAM-SSD (TCAM-256)performance improvement4.3%Graph Traversal · variant=TCAM-256 · locality=0% · comparison=TCAM (NP) · index-access-assumption=every access is a DRAM row miss
Source quote
L902: \tSG{Fourth, because TCAM-256 uses our optimized data structure, it} can further improve the performance for large graphs with vertices with high degrees with an average improvement of {14.5}% and {4.3}% over OOM and TCAM (NP), respectively.
BibTeX
@misc{wong2024tcam,
  author = {Ryan Wong and Nikita Kim and Kevin Higgs and Sapan Agarwal and Engin İpek and Saugata Ghose and Ben Feinberg},
  title = {{TCAM-SSD: A Framework for Search-Based Computing in Solid-State Drives}},
  year = {2024},
  eprint = {2403.06938},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.06938},
}
Figure