Abstract
In recent years, emerging storage hardware technologies have focused on divergent goals: better performance or lower cost-per-bit. Correspondingly, data systems that employ these technologies are typically optimized either to be fast (but expensive) or cheap (but slow). We take a different approach: by architecting a storage engine to natively utilize two tiers of fast and low-cost storage technologies, we can achieve a Pareto-efficient balance between performance and cost-per-bit. This paper presents the design and implementation of PrismDB, a novel key-value store that exploits two extreme ends of the spectrum of modern NVMe storage technologies (3D XPoint and QLC NAND) simultaneously. Our key contribution is how to efficiently migrate and compact data between two different storage tiers. Inspired by the classic cost-benefit analysis of log cleaning, we develop a new algorithm for multi-tiered storage compaction that balances the benefit of reclaiming space for hot objects in fast storage with the cost of compaction I/O in slow storage. Compared to the standard use of RocksDB on flash in datacenters today, PrismDB's average throughput on tiered storage is 3.3$\times$ faster and its read tail latency is 2$\times$ better, using equivalently priced hardware.
Introduction
Modern storage hardware is splitting into two extremes: high-performance but expensive Non-Volatile Memory (NVM) like Intel Optane and dense, cheap, but slow flash like QLC NAND. To optimize for both performance and cost, system architects often attempt to use a small amount of NVM as a fast tier and a large amount of QLC as a capacity tier. However, existing key-value stores like RocksDB are optimized for single-tier storage. Retrofitting them for multi-tier setups—either by using NVM as a simple cache or mapping the top levels of a Log-Structured Merge (LSM) tree to NVM—often leads to significant performance degradation.
The Problem with Multi-Tier LSM
LSM trees are inherently write-driven and rely on constant sorting and merging of data. When the top levels of an LSM tree are pinned to NVM, the limited space in those levels quickly fills up, triggering a cascade of background compactions. This "pinning vs. compaction" trade-off starves the system of free space, forcing it to constantly merge data down to flash. This process consumes excessive CPU cycles for sorting and causes massive write amplification on the slower flash tier, negating the benefits of the fast NVM storage.
PrismDB Architecture and Methods
PrismDB addresses these issues by abandoning the monolithic LSM tree in favor of a hybrid data layout tailored to the physics of each storage tier:
- NVM Tier (Slabs): Since NVM supports fast random writes without the penalty of write amplification, PrismDB stores hot data in unsorted, slab-based files. This allows for fast in-place updates and inserts without wasting CPU on unnecessary sorting.
- Flash Tier (Sorted Logs): Cold data is demoted to flash and stored in Sorted String Tables (SSTables). This ensures that writes to flash remain strictly sequential, which is critical for the endurance and performance of QLC NAND.
To manage data movement, PrismDB introduces Multi-tiered Storage Compaction (MSC). Inspired by log-structured file system cleaning, MSC calculates a cost-benefit score for migrating data: the benefit is the amount of cold data moved to flash, and the cost is the flash I/O required for the merge. This is supported by a lightweight multi-bit clock algorithm for popularity tracking and Approx-MSC, which uses bucketed key spaces to select compaction ranges efficiently.
Key Insights
A primary insight of this work is that sorting on NVM is often a waste of resources. Profiling standard LSM implementations on NVM revealed that 80% of compaction time was spent sorting data. Furthermore, while pinning hot data in NVM improves cache hits, a significant portion of reads still eventually hit the flash tier, making efficient cross-tier management essential.
By treating tier migration as a cost-benefit garbage collection problem, PrismDB maximizes the eviction of cold data per flash write, drastically reducing write amplification.
Key Results
PrismDB was evaluated using YCSB benchmarks and real-world Twitter production traces, demonstrating significant gains:
- Throughput and Latency: PrismDB achieved 3.3x higher average throughput and 2x better read tail latency compared to a standard RocksDB setup on TLC flash with equivalent hardware costs.
- Comparison to State-of-the-Art: PrismDB consistently outperformed other multi-tier systems like Mutant and SpanDB. With strict durability enabled, it achieved 3x higher throughput than SpanDB.
- Real-World Performance: On insert-heavy Twitter traces, PrismDB delivered 43% higher throughput than RocksDB.
- I/O Efficiency: The MSC algorithm reduced flash write I/O by over 2.5x compared to naive random-selection policies.
Limitations and Future Work
While PrismDB offers substantial improvements, some challenges remain. For extremely write-heavy workloads, the volume of data moving to flash may still challenge QLC endurance. Additionally, scan performance is currently sub-optimal due to the lack of a sophisticated prefetcher. Future work will focus on implementing an application-level page cache to better handle tiny objects (<128B), building a prefetcher for scans, and implementing auto-tuning algorithms for hot-data pinning thresholds.
Summary updated