Comments (3)
I am not a Facebook employee, but my view on having KV store and KV cache as two separate components:
-
design requirements: a) RocksDB are optimized for writes, not reads, while Cachelib is optimized for reads. b) RocksDB and Cachelib have different features sets, which allows different optimizations. For example, not having to provide durability guarantee and range request feature allow performance improvement (no WAL, no need to maintain data in sorted order, etc.).
-
optimization goals: because the usage difference, a cache and a store have different optimizations goals. A cache prioritizes for efficiency (miss ratio), while a store prioritizes durability and write throughput (among many others).
-
traffic and usage difference: a) a cache is deployed in front of a store, which means a cache sees more read traffic, while store sees more write traffic. b) cache can be used to store data that can tolerate some degree of loss (for example, rate limiters).
-
deployment difference: a) because KV store deployments act as the source of truth, and require strong consistency, durability guarantee (data loss is not acceptable), they are usually deployed/replicated on multiple nodes with consensus algorithms like Raft. As a comparison, data in cache can be evicted, cache can be used/deployed as either in-application library or distributed cache (like Memcached). b) a cache can be deployed as DRAM only, a store usually won't be deployed as DRAM only due to high cost of DRAM and difficulty of achieving durability with DRAM.
-
capacity planning: a) in terms of working set, key-value stores require provisioning sufficient storage capacity to hold all the data, while caching does not need to store the whole working set. Therefore, the capacity usage of KV store grows much faster than KV cache, which means coupling the two into one library may complicate capacity planning and deployments.
from cachelib.
@1a1a11a thank you so much man, this is very clear!
from cachelib.
@gaowayne Juncheng covered the main reasons why CacheLib and RocksDB are two separate libraries. One thing I would add is that database storage engine's primary table stake is durability of data that is written. This is not the case for caches which by nature can evict data as more are added. This difference in expectation is leveraged in the design of both the libraries to exploit the best of other constraints and optimizing the read performance for caching and write performance and feature set for storage engines.
from cachelib.
Related Issues (20)
- Some questions in resizing the cachelib pool size HOT 2
- Is there any plan to provide an Java SDK for this cachelib ? HOT 2
- Fail to build dependency fbthrift (with errors reported in fmt) HOT 5
- make clean option for contrib/build.sh HOT 1
- build error about fizz on ubuntu22.04 HOT 2
- CDN trace expected behavior HOT 2
- Enable FDP for CacheBench HOT 26
- qDepth Support for NVM Cache HOT 6
- Questions about trace files when running cachebench HOT 2
- Running simple-cache-example gives an error, flag 'v' was defined more than once HOT 6
- OSS build broken as of May, 2024 -> PRs are all blocked HOT 7
- No build support for Fedora37 OS HOT 4
- failed to build CacheLib following document HOT 2
- Build fails on debian-10 HOT 2
- Segmentation fault while fetching refcount HOT 2
- Minimum Limit For Cache Allocation? HOT 1
- build failed when building dependency 'fbthrift' HOT 3
- Build issue with CacheLib with missing source files HOT 3
- [Seeking Volunteers] Add new builds to CacheLib HOT 2
- Build is failing with error: ‘fmt::v10::detail::type_is_unformattable_for<const facebook::cachelib::navy::Status, char> _’ has incomplete type 1600 | type_is_unformattable_for<T, typename Context::char_type> _; | ^ HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cachelib.