Scuba (Real-time Analytics)
maang.io System Design Series
Scuba is Facebook's in-memory database for real-time, ad-hoc analytics — the tool engineers reach for to debug a live incident. It holds recent data fully in RAM, sharded across many leaf servers, and answers arbitrary aggregations in sub-seconds via a scatter-gather tree, using sampling to bound cost. It trades exactness and history for speed and freshness — the opposite bargain from a warehouse.
This deep dive comes in three parts:
- Foundations & Core Concepts — in-memory columnar storage and the fresh-vs-exact trade.
- Internals — the scatter-gather aggregator tree, sampling, and sizing, with worked numbers.
- Interview — Staff/Principal Q&A: real-time analytics design and sampling trade-offs.