Kangaroo: A new flash cache optimized for tiny objects
Kangaroo is a flash cache for tiny objects (~100 bytes) that pairs a small log-structured cache (KLog, ~5% of flash) with a large set-associative cache (KSet). This avoids both the per-object DRAM index cost of log-structured caches and the ~40x write amplification of set-associative ones. When objects leave KLog, Kangaroo batches all objects that map to the same KSet set, amortizing each 4 KB page write across several objects. A threshold admission policy drops objects when too few would be written together. Built into CacheLib and evaluated on Facebook and Twitter social-graph traces, it cuts misses by 29% versus set-associative and 56% versus log-structured caches under realistic DRAM and write-rate limits.
Related posts
- Optimizing cloud economics with linear elastic caching
Google Research mediumAdeptLinear elastic caching treats cache memory as a cost that grows linearly with data size and time held, and frames each page's retention as a ski rental problem: keep paying for RAM or evict and risk a miss penalty. The key theoretical result is that per-page rental duration (a TTL) and capacity-bound eviction (e.g. LRU) can be optimized separately. In Spanner, a shallow decision-tree model predicts a TTL per page from data size, miss cost and operation type. It cut memory by 15.5% and TCO by about 5%, with 5.5% more misses but only a 0.5% rise in I/O cost. On public traces, learned and breakeven/randomized TTL variants beat a fixed-size GDSF baseline on total cost and miss rate, with larger gains as memory gets more expensive relative to misses.
- Astra Dynamic Chunks: How We Saved by Redesigning a Key Part of Astra
Slack Engineering mediumAdeptSlack's Astra log search engine replaced fixed-size chunk slots on cache nodes with dynamically sized chunks, because undersized chunks wasted allocated disk space and oversized chunks from recovery tasks could overflow their slots. Cache nodes now advertise disk capacity, and the manager persists chunk-to-node assignments and node metadata in ZooKeeper, using first-fit bin packing to place chunks onto as few nodes as possible. The rollout ran behind a feature flag on one of two data replicas, moving from small clusters to large ones. It cut cache nodes by up to 50% on clusters with many undersized chunks and reduced overall cache node cost by 20%.
- Introducing the ClickHouse Query Cache
ClickHouse mediumAdept
ClickHouse v23.1 adds an experimental query cache that stores results of expensive SELECT queries for a configurable TTL (60 s by default), cutting a 9-second aggregation over 3.1 billion GitHub events to 0.04 s on repeat runs. A walkthrough shows a common pitfall: results larger than the 1 MiB default max_entry_size are silently skipped, which trace logs and system.query_cache reveal. Settings control read/write-only use, minimum query duration or run counts before caching, caching of non-deterministic functions, and sharing entries between users. The cache is deliberately transactionally inconsistent: inserts and merges don't invalidate entries, which avoids MySQL-style scalability problems. Entries are keyed by the query AST rather than its text.
- Cache made consistent
Meta Engineering mediumAdeptMeta raised TAO's cache consistency from six nines to ten nines (99.99999999% of cache writes consistent within five minutes) by treating consistency as a measurement and debugging problem rather than only a protocol problem. Polaris acts as a client that consumes invalidation events and checks cache replicas against client-observable invariants. It uses multi-timescale retry queues and defers expensive cache-bypass database reads, which avoids false positives without overloading the database. A stateful consistency-tracing library logs cache mutations only in the short window after a write, where fills and invalidations race. That gave engineers complete timelines for bugs such as a versioned entry that stayed stale indefinitely.
- Separation of storage and compute without a performance tradeoff
Neon easyNovice
Neon's Local File Cache (LFC) sits between Postgres shared buffers and Neon's remote multi-tenant page storage. It uses the Linux page cache for RAM-like latency and can spill to local NVMe, so Neon keeps elastic, decoupled storage while matching local-disk Postgres performance. On a TPCC-like sysbench benchmark at 8CU, a 500GB LFC raised QPS from 12,512 to 17,030 and cut p99 latency from 593ms to 384ms, close to a local-disk setup needing 929GB. Sizing the LFC to the estimated working set (180GB) lost only about 10% of peak QPS.