LSM-tree metrics database

DesignHard50 minMeta and Google style

Your task

Design the LSM-tree storage engine for a time-series metrics database ingesting 4M data points/sec across 50k active series, with a read pattern dominated by recent-window range scans (last 1h) but occasional historical scans over 90 days. Writes are append-heavy and roughly monotonic in timestamp per series; the SLA is sub-50ms p99 for recent-window reads and bounded disk usage with a 14-day hot tier on NVMe and a cold tier on object storage. Walk through the memtable/SSTable layout, the compaction strategy, and how you keep read amplification low for recent windows while controlling write amplification.

It covers

  • Compaction
  • Write amplification
  • Bloom filters