SwapKV: A Hotness Aware In-Memory Key-Value Store for Hybrid Memory Systems

In-memory Key-Value (KV) stores are widely deployed in modern data centers. These systems generally use DRAM as their storage medium, causing huge hardware costs. The emerging persistent memory (PMEM) is a potential substitute for DRAM, which has a lower price and larger capacity, but lower access speed and bandwidth. Many prior studies strive to build hybrid memory systems to retain both the advantages of DRAM and PMEM. However, they are either application agnostic or simply take DRAM as a cache, which are both not efficient for in-memory KV stores. In this paper, we propose SwapKV, a well-designed in-memory KV store for hybrid DRAM-PMEM system. SwapKV has several promising properties. First, SwapKV combines DRAM and PMEM to a uniform memory pool and only stores one copy of data, which maximizes capacity utilization. Second, SwapKV maps all writing operations to DRAM and migrates data to PMEM with large blocks asynchronously, which mitigates the intrinsic inefficiency of PMEM for writing operations. Third, SwapKV maintains the hot data in DRAM through an efficient hotness filtering and data swapping mechanism, which ensures high system throughput and responsiveness. We implement SwapKV and evaluate it under various workload patterns. The results demonstrate that SwapKV improves the throughput by 11 <inline-formula><tex-math notation="LaTeX">$\!\sim\!$</tex-math><alternatives><mml:math><mml:mrow><mml:mspace width="-0.166667em"/><mml:mo>∼</mml:mo><mml:mspace width="-0.166667em"/></mml:mrow></mml:math><inline-graphic xlink:href="cui-ieq1-3077264.gif"/></alternatives></inline-formula> 41 percent compared to the state-of-the-art alternatives.