key value stores
play

Key-Value Stores Key-value stores are popular. web searching, - PowerPoint PPT Presentation

AC AC-Ke Key : Adaptive Caching for LSM-based Key-Value Stores Fenggang Wu , Ming-Hong Yang, Baoquan Zhang, David H.C. Du University of Minnesota, Twin Cities July 2020. USENIX ATC20 Key-Value Stores Key-value stores are popular. web


  1. AC AC-Ke Key : Adaptive Caching for LSM-based Key-Value Stores Fenggang Wu , Ming-Hong Yang, Baoquan Zhang, David H.C. Du University of Minnesota, Twin Cities July 2020. USENIX ATC’20

  2. Key-Value Stores • Key-value stores are popular. • web searching, social networks, e-commerce, etc. • LSM-tree based Key-value stores (LSM-KVS) are widely used.

  3. KV LSM Tree -- Write DRAM batch write Storage Level 1 merge Ø write-optimized Ø batch and write sequentially 10X Larger Ø never perform scattered in-place update Level 2 merge Level 3

  4. Point Lookup LSM Tree -- Read K DRAM Storage Level 1 Block : Ø sorted range of Key/Value pairs Ø basic I/O Unit (16KB) Level 2 Suffer from read performance issue Ø Potentially every level needs to be checked Ø Fetch whole block when only one key is queried Level 3

  5. Range Query LSM Tree -- Read K1, K2 merge Result DRAM Storage Level 1 Level 2 Read performance issue : Both point lookup and range query will fetch many blocks for one query. Level 3

  6. Addressing Read Issue Can we use cache? Yes, workloads have hotspots ! Cache Space DRAM Storage “One key contributes 20% of a server’s requests” Level 1 Memcache [Atikoglu 2012] “1% of the keys takes up 50% of total point lookup” ZippyDB@Facebook [Cao, 2020] Level 2 Range queries have hot ranges too [Cooper 2012, Gilad 2020] Level 3

  7. Addressing Read Issue Can we use cache? Yes, workloads have hotspots ! Cache Space DRAM But… popular caching Storage schemes do NOT fit!! Level 1 Unique caching challenge in LSM-KVS Ø Data have different sizes/level -> different cache cost/benefit. Ø Distinct types of read: point lookup and range query. Level 2 Existing Solutions Ø General caching schemes: Ø No special consideration about the cache cost/benefit in LSM-KVS. Ø Existing LSM-KVS caching: Ø Favors only particular workload. Level 3 Ø Not efficient for a different/dynamic workload.

  8. Different items can be cached Favorite workload Block KV KP Block : Range query Block Cache Key/Value KV : Point lookup Key/Value KV Cache Key/Value Key/P (small/hot value) Point … Cache P KP : Point lookup DRAM Key/Value KP Cache (large/warm value) Storage Block KV KP Point Range Adaptive LevelDB Yes No No Inefficient Supported Fix-sized RocksDB Yes Yes No Large Value inefficient Supported Fix-sized Cassandra No Yes Yes Efficient Not Supported Fix-sized AC-Key Yes Yes Yes Efficient Supported Adaptive-sized Key challenge : adjust the sizes of different types of caches according to dynamic workloads

  9. Cache Size Adjustment using Ghost Cache Real Cache Ghost Cache Block Ghost boundary Cache Hit Block Point block num block Ø Ghost Cache Ø Store only metadata of evicted entries from the real cache Point Ghost Ø On ghost hit: Push boundary away to grow the real cache boundary Cache Hit Block Point Finally reach to a dynamic equilibrium for a given workload.

  10. AC-Key – Hierarchical Adaptive Caching Ø Upper level Point Cache vs Block Cache Ø Lower level: KV Cache vs KP Cache Real Cache Ghost Cache Point Cache Block Cache Upper Level Block dynamic boundary Lower Level KP KV KV Cache KP Cache

  11. Other Solved Challenges Ø Measure caching efficiency to consider different entry cost/benefit Ø Special cached entry handling due to compaction and flush

  12. Evaluation Ø Implement AC-Key based on RocksDB Ø Evaluate with various workloads and system settings For complete evaluation result: check out our paper

  13. Evaluation pure-block-cache / industry ac-key rocksdb pure-kv pure-kp offline 4000 3000 QPS 2000 1000 0 0% 20% 40% 60% 80% 100% Range Query Ratio all point-lookup workload all range-query workload

  14. Evaluating Adaptive Size pure range-query pure point-lookup block kp kv 1200 Size (KB) 800 winner 1000-1500 1500 400 500-1000 1000 QPS 0-500 500 0 0 0 0.4 0 0.5 1 1.5 2 2.5 3 0.8 0 0.2 0.4 Block Cache 0.6 ac-key offline 0.8 1 KP Cache Ratio 6000 Ratio competing scheme: offline 4000 QPS try different combinations • 2000 • 1/10 cache granularity • pick the winner 0 • fixed -configuration 0 0.5 1 1.5 2 2.5 3 Operations (million)

  15. Summary Ø LSM-based key-value store is widely used Ø Write-optimized; but has read performance issue. Ø AC-Key: Adaptive caching for LSM-based key-value stores. Ø Integrating all the KV, KP, Block cache components. Ø Hierarchical size-adaptive design. Ø Outperform industry solutions.

  16. Th Thank y you ou! Fenggang Wu wuxx0835@umn.edu

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend