---
title: "Kangaroo: A new flash cache optimized for tiny objects"
description: "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)."
url: "https://swe.quest/articles/kangaroo-a-new-flash-cache-optimized-for-tiny-objects-925482fcf04e3dc4"
canonical: "https://engineering.fb.com/2021/10/26/core-infra/kangaroo/"
source: "Meta Engineering"
published: "2021-10-26"
difficulty: "hard"
kind: "Research"
reading_minutes: 5
tags: ["caching","storage-systems","data-structures","hardware"]
---

# Kangaroo: A new flash cache optimized for tiny objects

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2021-10-26, 5 min read, Research. Original: [https://engineering.fb.com/2021/10/26/core-infra/kangaroo/](https://engineering.fb.com/2021/10/26/core-infra/kangaroo/)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Caching](https://swe.quest/tags/caching.md) (Backend & APIs)
- [Storage systems](https://swe.quest/tags/storage-systems.md) (Infrastructure)
- [Data structures](https://swe.quest/tags/data-structures.md) (Architecture & design)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)

## Prerequisites

- flash/SSD write granularity
- cache eviction and admission ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- Bloom filters
- log-structured storage

## Keywords

Kangaroo, CacheLib, KLog, KSet, SOSP 2021, Bloom filter

## Related posts

- [Optimizing cloud economics with linear elastic caching](https://swe.quest/articles/optimizing-cloud-economics-with-linear-elastic-caching-1df4c9ca9645409f.md): Google Research · 2026-06-25 · Medium · 7 min read · Caching, Algorithms, Cost optimization, Machine learning, Databases
  Linear 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.
- [Astra Dynamic Chunks: How We Saved by Redesigning a Key Part of Astra](https://swe.quest/articles/astra-dynamic-chunks-how-we-saved-by-redesigning-a-key-part-of-astra-2ad19dfa88650f39.md): Slack Engineering · 2024-11-18 · Medium · 6 min read · Search, Cost optimization, Storage systems, Algorithms, Deployment
  Slack'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.
- [Introducing the ClickHouse Query Cache](https://swe.quest/articles/introducing-the-clickhouse-query-cache-4c8e8c32056d93c8.md): ClickHouse · 2023-02-09 · Medium · 9 min read · Caching, Analytics & OLAP, Databases, Performance engineering
  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.
- [Cache made consistent](https://swe.quest/articles/cache-made-consistent-61a6d7479b73ae8d.md): Meta Engineering · 2022-06-08 · Medium · 13 min read · Caching, Consistency models, Observability, Distributed systems, Debugging
  Meta 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.
- [Separation of storage and compute without a performance tradeoff](https://swe.quest/articles/separation-of-storage-and-compute-without-a-performance-tradeoff-25a1b45d403d8baf.md): Neon · 2025-07-11 · Easy · 6 min read · PostgreSQL, Caching, Performance engineering, Serverless, Storage systems
  Neon's Local File Cache (LFC) sits between Postgres shared buffers and Neon's remote multi-tenant page storage.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
