Abstract
Flash storage is an attractive alternative to DRAM for key-value caches due to its lower cost-per-bit and comparable latency in networked environments. However, SSDs suffer from limited write endurance and high write amplification under the small, random write patterns typical of cache workloads. We present Flashield, a hybrid DRAM-SSD cache that minimizes flash writes. Flashield uses DRAM as a filter, employing a machine learning classifier to admit only 'flash-worthy' objects—those likely to be frequently read and long-lived. By aggregating these objects into large sequential segments, Flashield virtually eliminates device-level write amplification. Furthermore, it utilizes a compact 4-byte-per-object in-memory index to minimize DRAM overhead. Evaluation against real-world traces shows that Flashield reduces write amplification by a median of 5x compared to state-of-the-art systems while maintaining competitive hit rates.
Introduction
Key-value (KV) caches like Memcached are critical for modern web applications. While DRAM has traditionally been the medium of choice, its high cost and power consumption have led researchers to explore flash storage. SSDs offer 10x lower cost-per-bit and, in networked settings, provide access latencies nearly identical to DRAM. However, the mismatch between the small, random write patterns of KV workloads and the block-based architecture of SSDs leads to significant performance and longevity issues.
The Challenge: Write Amplification
The primary barrier to flash-based caching is Write Amplification (WA), which occurs at two levels:
- Device-level (DLWA): SSDs must erase data in large blocks but write in smaller pages. Random writes force internal garbage collection, multiplying physical writes. As shown in the figure below, random writes can cause DLWA to spike to 8x, significantly shortening the drive's lifespan.
- Cache-level (CLWA): Standard caching policies often move data to flash that is quickly invalidated, resulting in "junk" writes.
Flashield Architecture
Flashield addresses these challenges by treating DRAM as a sophisticated "proving ground" for data before it is committed to flash.
DRAM as a Proving Ground
Instead of writing every new object to flash, Flashield retains all incoming data in DRAM. It uses a Support Vector Machine (SVM) classifier to predict an object's "flashiness"—the likelihood it will be read frequently in the future without being updated. This predictive admission control ensures that only high-value, long-lived data reaches the SSD.
Sequential Writing and Compact Indexing
Objects that pass the flashiness test are bundled into large (512MB) sequential segments. Writing these large segments to the SSD virtually eliminates DLWA. To manage the massive number of objects stored on flash without exhausting DRAM, Flashield employs a novel index requiring less than 4 bytes per object. It achieves this by omitting full keys from the in-memory index and using per-segment Bloom filters to minimize unnecessary flash reads.
Key Results
Evaluations using real-world Memcachier traces demonstrate that Flashield significantly outperforms existing state-of-the-art systems:
- Write Reduction: Flashield reduced write amplification by a median of 5x and an average of 16x compared to RIPQ.
- Hit Rate: The system maintained hit rates nearly identical to DRAM-only caches, proving that selective admission does not sacrifice performance.
- Efficiency: Flashield achieved 99% flash utilization with minimal overhead, requiring only 1.03 flash reads per hit on average.
Conclusion
Flashield demonstrates that by combining machine learning-based admission control with sequential write patterns and compact indexing, SSDs can be transformed into highly efficient, long-lasting tiers for key-value caching. This approach effectively bridges the gap between the performance requirements of modern workloads and the physical constraints of flash storage.
Summary updated