SDSystem DesignConcepts to case studies
System DesignDSA
x
0/311
Part 1: Foundations
Part 2: APIs and Communication
Part 3: Caching
Part 4: Data and Storage
Part 5: Architecture
Part 6: Distributed Systems
Part 7: Advanced Data Topics
Part 8: Operations and Security
Part 9: Estimation and Interview Method
Part 10: Case Studies
  • Design Ride Sharing (Uber/Lyft)
  • Design a Payment System
  • Design Ticket / Hotel Booking
  • Design a Search Engine
  • Design Google Maps
  • Design a Collaborative Editor (Google Docs)
  • Design a Metrics and Monitoring System
  • Design a Distributed Message Queue (Kafka-like)
  • Design an E-commerce System (Amazon)
  • Design a Content Recommendation System (YouTube/Netflix)
System Design/Case Studies/Hard
Interview case study

Design a Metrics and Monitoring System

Collect millions of data points a second, store them cheaply, query them fast and alert on them.

⏱ 36 min readHard case studyAdvanced25 cross-questionsHas visualizer
Prompt60-sec answer45-min plan1 Clarify2 Estimate3 API + Data4 Design5 Deep dives6 Scale7 Wrap upCross-questionsVariationsScoringMistakesCheat-sheet

StartThe prompt and what is really being tested

The interviewer says

“Design a metrics and monitoring system.”

It is short on purpose. Your first job is to make it specific.

What they checkWhy it matters
Pinning down the problem“Monitoring” can mean collecting numbers, storing them, drawing dashboards or paging people. A strong candidate asks which, how long data is kept, and how fast a query and an alert must be.
Sizing the write pathFive million samples a second is the number that shapes everything. The interviewer wants you to see that this is a write-heavy, append-only workload, and to price storage per sample.
Understanding cardinalityThe thing that really kills metrics systems is not volume, it is the number of distinct series. Naming this early, and showing how you cap it, is the senior signal.
Correct maths on stored dataYou cannot average percentiles, and a rollup cannot give back raw samples. The interviewer checks that you know what downsampling loses.
Monitoring the monitorThe system must keep working during the outage it is meant to detect. Alert reliability, missing data and a watcher for the watcher are where real systems fail.

TL;DRThe whole design in 60 seconds

A metrics system accepts a huge stream of tiny numbers (series identified by a name and labels, with a value every few seconds), stores them compactly in a time-series database, answers dashboard queries over time ranges, and runs alert rules that page a human. It is a write-heavy, append-only, read-by-time-range workload.

  • Scale: 500,000 hosts × 100 metrics = 50M series, scraped every 10 s, is 5M samples a second and about 430 billion a day. Raw that is 6.9 TB a day. Compressed (delta-of-delta timestamps, XOR floats) it is about 600 GB a day.
  • Ingest: agents scrape and batch, buffer on disk if the network breaks, and send through gateways to a queue. Writers shard by series hash, keep the newest data in memory with a write-ahead log, and cut an immutable block every two hours.
  • Storage: raw for 15 days, then 5-minute rollups for 13 months, then 1-hour rollups for 5 years. Rollups keep min, max, sum and count, so averages survive but individual samples do not.
  • Cardinality: a series is a unique label set, so one unbounded label (a user id) multiplies everything. Cap series per tenant, drop labels at the edge, and send per-user detail to logs or traces.
  • Queries: a query frontend splits long ranges into days, caches the immutable past, and picks a rollup by range. Percentiles come from mergeable histogram buckets, never from averaging percentiles.
  • Alerts: a sharded rule evaluator with a pending, firing, resolved state machine and a for duration, an alert manager that groups and routes, and a separate small watcher that pages if the whole system goes quiet.
💡How to use this page
Read the 60-second answer first. Then work through steps 1 to 7 in order, and try each step yourself before reading the model answer. Finish with the cross-questions: say your answer out loud, then open the model one.

PlanA 45-minute plan

4
4
4
7
16
7
3
Minutes per step (total 45). A guide, not a rule: move time to the part the interviewer cares about.
StepMinutesWhat to get done
1. Clarify4What is measured, push or pull, retention, query and alert latency, and what must survive an outage.
2. Estimate4Series, samples per second, bytes per sample, storage per tier, and what cardinality does.
3. API and data4Write and query calls, series identity, the label index and the compressed chunks.
4. High-level design7Agents, gateways, queue, ingesters, long-term blocks, query layer, alert evaluator.
5. Deep dives16Ingestion, storage and downsampling, cardinality, queries and percentiles, then alerting.
6. Scale and failures7A label explosion, a dead ingester, a partition, late data, and watching the watcher.
7. Wrap up3Recap, the trade-offs, and what you would build next.

Step 1Clarify requirementsabout 4 min

🤔
Pause. Try it yourself first
You have 60 seconds. Write five questions that would change your design. Hint: think about who the users are, how many distinct series there are, how long data is kept, how fast a dashboard and an alert must be, and what happens when monitoring itself is down.

Questions to ask, and why

AskWhy you ask itTypical answerHow it changes the design
What do we collect: infrastructure only, or application metrics with custom labels too?Custom labels are where cardinality comes from. Infrastructure metrics are stable and predictable.Both. Hosts and containers, plus application counters, gauges and histograms with labels.We need per-tenant series limits and a way to drop labels, not just a big disk.
Push or pull? Do agents send data, or does the system fetch it?It decides who controls the rate, how health checking works, and how it crosses firewalls.Agents on every host collect locally. Short-lived jobs must push.Pull for long-lived services (the server controls the rate and sees a dead target), plus a push gateway for batch jobs.
How many hosts, metrics and distinct series? How often do we sample?Series count times sampling rate is the write rate. Series count alone sizes the index and memory.500,000 hosts, about 100 metrics each, a sample every 10 seconds.50M series and 5M samples a second. We shard writers by series and plan memory per series.
How long do we keep data, and at what resolution?Keeping raw data forever is far too expensive. Retention tiers decide the storage bill.Raw for 15 days. Coarser rollups for 13 months, then hourly for 5 years.Downsampling jobs and several storage tiers, and queries that pick the right tier.
What queries must be fast, and how fast?Dashboards ask for aggregates over many series, not single points.Range queries with sum, rate and percentile grouped by a label. Under 2 seconds for 24 hours of data.A query frontend with splitting and caching, and an index from labels to series.
How fast must an alert fire, and how many rules are there?Alerting is a read workload that never stops, and it has its own reliability bar.About 1 million rules, each checked every 30 to 60 seconds. A page within 2 minutes of a real problem.A sharded evaluator reading recent data, and an alert manager that groups and deduplicates.
What happens to data and alerts if part of the system is down?The monitoring system has to work in the middle of an outage.Ingestion and alerting must stay available. A few minutes of delayed dashboards is acceptable.Agent buffering, a queue between ingest and storage, replicated writers, and redundant evaluators.
Is it multi-tenant? Is there one cluster or many regions?Tenants need isolation and limits. Regions decide whether we need a global query layer.Many teams share one platform. Run per region, with a global view on top.Per-tenant quotas, and a query layer that can fan out across regions.
Do we also store logs and traces?Logs and traces are far larger and have different access patterns.No. Metrics only, but we link to the logs and traces systems.We keep high-cardinality detail out of metrics and point to logs and traces for it.
Do we need exact values or are approximations fine?Exact percentiles over everything are very expensive. Approximations are cheap and good enough.Approximate percentiles from histograms are fine. Counters must be exact.Histograms with fixed buckets or a sketch, and exact counters.

Write the scope on the board

Functional (must do)
  • •Ingest counters, gauges and histograms with a name and labels, from hosts, containers and applications
  • •Query ranges of data with filters, aggregation and grouping, and draw dashboards
  • •Define alert rules, evaluate them continuously, and send notifications with grouping and silences
  • •Keep data in tiers and downsample older data automatically
  • •Limit each tenant, so one team cannot break the platform
Non-functional (how well)
  • •Ingest: 5M samples a second, with no loss when one machine fails
  • •Query: a 24-hour dashboard query in under 2 seconds at p99
  • •Alerts: a page within 2 minutes, with 99.99% of rule evaluations on time
  • •Durable: no more than a few seconds of data lost on a machine failure
  • •Cost: about 1.4 bytes per sample stored, and a hard cap on series per tenant
Out of scope (say it)
  • •Logs and distributed traces (separate systems with different storage)
  • •Anomaly detection and machine learning on the data
  • •A full dashboard builder and its permissions model
  • •Billing and chargeback beyond simple per-tenant counters
🎤
Say it out loud
“Let me confirm the scope. We collect infrastructure and application metrics with labels from about 500,000 hosts, around 100 metrics each, one sample every 10 seconds. That is 50 million series and 5 million samples a second. We keep raw data 15 days, coarse rollups for 13 months, hourly for 5 years. Dashboards must answer in about 2 seconds, and a million alert rules must page within 2 minutes. Ingestion and alerting must stay up even when other things fail. Logs and traces are out of scope. Does that match?”

Step 2Estimate the scaleabout 4 min

🤔
Pause. Try it yourself first
On paper: series count, samples a second, bytes a sample raw and compressed, storage per day and per tier, memory for the newest data, and the damage one bad label can do.

Assumptions (say them first)

AssumptionValue
Hosts500,000
Metrics per hostabout 100 (50M series)
Sampling interval10 seconds
Raw sample size16 bytes (8 timestamp + 8 value)
Compressed sample sizeabout 1.4 bytes (delta-of-delta + XOR, illustrative)
Head memory per active seriesabout 3 KB (illustrative)
Retentionraw 15 days, 5-minute rollups 13 months, 1-hour rollups 5 years
Values per rollup bucket4 (min, max, sum, count)
Alert rules1,000,000, each checked every 30 seconds
Dashboard load5,000 open dashboards, 12 queries each, refreshed every 30 seconds

The arithmetic, line by line

WhatMathsResult
Active series500,000 hosts × 100 metrics50 million series
Samples per second50,000,000 ÷ 10 s5 million per second
Samples per day5,000,000 × 86,400432 billion
Raw size per day432 billion × 16 bytes6.9 TB
Compressed per day432 billion × 1.4 bytesabout 600 GB
Raw tier, 15 days (one copy, and three copies)605 GB × 15, then × 39.1 TB, and 27 TB
Same 15 days without compression6.9 TB × 15104 TB (11 times more)
Head memory for the newest data50,000,000 series × 3 KB, then × 3 copies150 GB, and 450 GB (about 30 ingesters at 15 GB each)
5-minute rollups, 13 months50M × 288 buckets × 4 values × 1.4 B × 395 daysabout 32 TB
1-hour rollups, 5 years50M × 24 × 4 × 1.4 B × 1,825 daysabout 12 TB
All three tiers, one copy9.1 + 32 + 12about 53 TB, against 1,100 TB for 5 years of raw
Alert evaluation reads1,000,000 rules ÷ 30 s = 33,000 evaluations a second × 20 samples each × 30about 20M samples a second, 4 times the ingest rate
Dashboard queries, uncached5,000 × 12 ÷ 30 s = 2,000 queries a second × (100 series × 8,640 samples)about 1.7 billion samples a second (far too many to read raw)
Dashboard queries with cachingonly the newest 30 s is new: 100 series × 3 samples = 300 per query2,880 times less work per refresh
One bad label (1 million values on 14 metrics)1,000,000 × 14 = 14 million new series28% more series, 42 GB more head memory, 169 GB a day more
What the numbers tell us about the design
  • •The write rate (5M a second) is large but steady and append-only. It is cheap to absorb if writes are batched and sharded by series.
  • •Compression is the biggest cost lever: about 1.4 bytes a sample instead of 16 turns 104 TB of raw data for 15 days into about 9 TB.
  • •Long retention is only affordable with rollups. Five years of raw would be about 1,100 TB. The tiered plan is about 53 TB, 20 times less.
  • •Memory scales with series, not samples: 50M series need about 150 GB for the newest block. The thing to protect is the series count.
  • •Alerting reads about four times more samples than ingest writes, so rule evaluation is a major load. Dashboards must be cached, or they would melt the store.
  • •One careless label can add 14 million series in a deploy. This is why we put hard limits at the edge, per tenant.
🎤
Say it out loud
“Let me do the maths. 500,000 hosts with 100 metrics is 50 million series. One sample every 10 seconds is 5 million samples a second, or 432 billion a day. Raw at 16 bytes that is 6.9 terabytes a day, but time-series compression gets it to about 1.4 bytes a sample, so about 600 gigabytes a day. Memory depends on series, not samples: 50 million series at about 3 kilobytes is 150 gigabytes for the newest data, so I plan about 30 ingesters with three copies. Keeping 5 years raw would be over a petabyte, so I use rollups and keep about 53 terabytes. And one label with a million values on 14 metrics adds 14 million series, so the real defence is a series limit at the edge.”

Step 3Define the API and the data modelabout 4 min

🤔
Pause. Try it yourself first
Write the call an agent makes to send samples, the query a dashboard makes, and the shape of one series. What identifies a series, and how do you find all series that match a filter without scanning them all?

Endpoints

MethodPathRequestResponseNotes
POST/v1/write{ samples: [{ name, labels, ts, value }] } (batched, compressed)204, or 429 with Retry-After, or 400 for a bad batchAuthenticate the tenant. Accept batches of thousands. 429 tells the agent to slow down and buffer. Reject a batch that would create too many new series, with a clear error.
GET/v1/query_range?expr=sum(rate(http_requests_total{service="api"}[5m])) by (status)&start&end&step200 { series: [{ labels, points: [[ts, value]] }] }The step sets the output resolution. The server picks a raw or rolled-up tier by range, and enforces limits on series, samples and time.
GET/v1/series?match[]={service="api"}&start&end200 { series: [labels] }Lists series that match a selector. Used by dashboards for drop-downs. Capped, because it can be huge.
PUT/v1/rules/{group}{ rules: [{ name, expr, for, labels, annotations }] }200 { version }Create or replace alert rules. Validate that the expression parses and is not too expensive. Store with a version.
POST/v1/alerts (to the alert manager)[{ labels, annotations, startsAt, endsAt }]200Evaluators send firing and resolved alerts. The manager groups, deduplicates, silences and routes them to notification channels.

Data model

ConceptWhat it isWhy it is shaped this way
SeriesA unique metric name plus a sorted set of label pairs, such as http_requests_total{service=api, status=500}Every distinct label set is a separate series. This is why cardinality is the main cost.
Series idA small integer given to each series when first seenIndex and chunks refer to the id, not the long label text, which saves space.
Label indexFor each label=value pair, a sorted list of series ids (a posting list)To match {service=api, status=500} we intersect two sorted lists. No scan of all series.
ChunkA block of compressed samples for one series over a short spanDelta-of-delta timestamps and XOR values make about 1.4 bytes a sample.
BlockAn immutable set of chunks plus an index for a time span, such as 2 hoursImmutable blocks are easy to cache, copy to object storage, replicate and delete as a whole.
HeadThe newest, still-mutable data in memory, backed by a write-ahead logWrites go to memory fast, and the log makes a crash safe.
How a series and a query meet
-- A sample on the wire
http_requests_total{service="api", region="eu", status="500"}  ts=1733300000  value=48211

-- Series identity: name + sorted labels -> id 7314902
-- Label index (posting lists, sorted series ids):
service="api"  -> [ ..., 7314902, 7314911, ... ]
status="500"   -> [ ..., 7314902, 9020331, ... ]
-- query {service="api", status="500"}  =  intersect the two lists, then read those chunks

-- Chunk for series 7314902, block 2024-12-04 08:00-10:00:
first ts, first value, then per sample: delta-of-delta of ts (often 0 = 1 bit),
and XOR with the previous value (often few bits when the value changes little)
📝Which store, and why
The newest data lives in memory (the head) with a write-ahead log, because ingestion is a flood of small appends. Older data is cut into immutable, compressed, time-bounded blocks with their own label index, stored on local disk and then in object storage, which is cheap and durable. This is a purpose-built time-series store, not a general SQL database: the workload is append-only, ordered by time, and read as ranges.
🎤
Say it out loud
“Agents send batches of samples to a write endpoint, with the tenant in the credential, and get a 429 if they must slow down. Queries are range queries with an expression and a step, and alert rules are stored with a version. A series is a metric name plus its sorted labels, with a small integer id. A label index maps each label pair to a sorted list of series ids, so a selector is an intersection of lists. Samples live in compressed chunks inside immutable two-hour blocks, and the newest data sits in memory with a write-ahead log. This is a time-series store, not a general database.”

Step 4Draw the high-level designabout 7 min

🤔
Pause. Try it yourself first
Draw the boxes that take a sample from a host to a dashboard and to a pager. Where do you buffer? What can fail without losing data? Which part must watch the whole thing from outside?
Metrics system: high-level design
🖥️Hosts + agentsscrape, batch, disk buffer
→↓batched writes
🚪Ingest gatewaysauth, limits, validate
→↓by series hash
📨Queue (Kafka-like)decouples, absorbs bursts
Write path
⚙️Ingesters (sharded)head in memory + WAL, 3 copies
🧱Blocks every 2 hcompact, index, downsample
🪣Object storagelong-term, cheap
Read path
🧭Query frontendsplit, cache, limits
🔎Queriersmerge head + blocks
📊Dashboards
Alerting
📏Rule evaluatorssharded, HA pairs
🔔Alert managergroup, silence, route
📟Pager, chat, email
Watcher (separate)
👁️Meta-monitorsmall, independent
💓Dead man's switchpages if silence
Writes flow left to right through a queue into sharded ingesters. Reads and alerts come from the same store. A separate small watcher monitors the whole system.
ComponentWhat it does
Agent (on every host)Collects local metrics, adds labels, batches samples, and buffers them on disk if the network or gateway is down.
Ingest gatewaysAuthenticate the tenant, apply rate and series limits, validate the batch, and write to the queue. Stateless, so they scale out.
QueueHolds samples between gateways and ingesters. It absorbs bursts, lets ingesters restart without data loss, and gives replay. Partitioned by series hash.
IngestersOwn a slice of the series. Append to a write-ahead log and the in-memory head. Every two hours they cut an immutable block.
Compactor and downsamplerMerge small blocks into larger ones, build the index, write rollups, and upload blocks to object storage. Drop blocks past retention.
Query frontend and queriersSplit long ranges into days, cache results, choose a tier, fan out to ingesters and blocks, and merge the answer under limits.
Rule evaluatorsRun alert and recording rules on a schedule, keep the pending, firing and resolved state, and send alerts to the alert manager.
Alert managerDeduplicates the alerts from redundant evaluators, groups them, applies silences and inhibition, and routes them to people.
Meta-monitorA small, separate system that watches the platform and pages if the platform stops reporting. It must not depend on the thing it watches.
Write path (follow one request)
  1. An agent collects the host's metrics every 10 seconds and attaches labels (host, service, region).
  2. It batches samples and sends them to an ingest gateway. If that fails it keeps them in a bounded on-disk buffer and retries with backoff.
  3. The gateway authenticates the tenant, checks the rate and the series limit, drops denied labels, and rejects a bad batch.
  4. It writes the samples to the queue, partitioned by a hash of the series, so each series always goes to the same ingester.
  5. The ingester appends to its write-ahead log, then to the in-memory head, and acknowledges. Three ingesters hold each series.
  6. Every two hours the head is cut into an immutable block with an index. The compactor merges and downsamples blocks and uploads them to object storage.
Read path (follow one request)
  1. A dashboard sends a range query to the query frontend, with an expression, a start, an end and a step.
  2. The frontend checks the tenant's limits and splits a long range into days. Days already in the past come from a cache.
  3. For each part it picks the tier: raw for recent and short ranges, rollups for long ranges.
  4. Queriers find matching series using the label index, then read chunks from ingesters (newest data) and from blocks in object storage.
  5. They merge the results (sum, rate, histogram quantile) and return points at the requested step.
  6. The frontend stores the new parts in the cache, so the next refresh only computes the last few seconds.
🎤
Say it out loud
“Here is the picture. Agents on each host scrape and batch, and buffer to disk if the network is down. Ingest gateways authenticate, apply rate and series limits, and write to a queue partitioned by series hash. Ingesters own slices of series, append to a write-ahead log and the in-memory head, keep three copies, and every two hours cut an immutable block that is compacted, downsampled and uploaded to object storage. Reads go through a query frontend that splits and caches, and queriers that merge the newest data with blocks. Alerts come from sharded rule evaluators into an alert manager. And a small separate watcher pages us if the whole platform goes quiet.”

Step 5Deep dive into the hard partsabout 16 min

🧠The pattern for every deep dive
Problem → options → pick one → say why → say what it costs. Interviewers score the reasoning more than the choice.
5.1

The ingestion path: push or pull, and writing 5 million samples a second

The problem: Five million samples a second arrive from half a million machines, in bursts. Agents fail and restart, networks drop, clocks differ, and a single slow storage node must not cause lost data or an outage. We also need to know when a machine has stopped reporting.

OptionHow it worksGoodBad
Push from every hostEach agent sends its samples to a central endpoint on a schedule.Works through firewalls and for short-lived jobs. Simple for the host.The server does not control the rate. A dead host is silent, and silence looks like no data, not a failure. Bad agents can flood the system.
Pull (scrape)The server keeps a list of targets (from service discovery) and fetches each one every 10 seconds.The server sets the rate. A failed fetch is an immediate, visible signal that the target is down. Easy to test a target by hand.Needs service discovery and network reach to every target. Short-lived jobs may finish before a scrape. Hard across firewalls and NAT.
Local agent scrapes, then pushes batchesA small agent on each host or cluster pulls from local targets, then pushes compressed batches to the gateways.Local pull gives health signals, and batched push crosses networks. Agents can buffer, add labels and drop unwanted ones before the data leaves the machine.One more piece to run and upgrade on every host. The agent itself must be monitored.
Stream everything through the queue firstAll writers publish to a partitioned log. Ingesters read and write to storage at their own pace.Decouples ingest from storage, absorbs bursts, and allows replay after a bug or a restart.More infrastructure, and a little more delay. The queue itself needs capacity planning.
Pick
A local agent that scrapes and then pushes batches through gateways into a partitioned queue, with a push path for short-lived jobs

The agent gets the best of both models: pull-style health (a failed local scrape is a clear signal) and push-style reach. It also does cheap, useful work at the edge: it batches (thousands of samples per request), compresses, adds labels, drops denied labels, and keeps a bounded disk buffer, so a ten-minute outage loses nothing.

The queue sits between the gateways and the writers. It is partitioned by a hash of the series, so every sample of a series lands on the same ingester, in order, and the ingester can append to one chunk. Ingesters acknowledge after writing the log, keep three copies, and can fall behind briefly without data loss. The cost is one more system to run, which we accept because it turns an outage of storage into a delay, not a loss.

ProblemHow we handle it
Out-of-order or late samplesAccept a small window (for example 10 minutes) into the open head. Older than that goes to a slower backfill path, or is dropped with a counter.
Clock skew between hostsUse the agent's timestamp, but reject samples far in the future, and let the gateway stamp samples that have none. Watch for hosts with bad clocks.
BackpressureReturn 429 with Retry-After. Agents slow down and buffer, then drop the oldest data first when the buffer is full, and count what they dropped.
Duplicate batches after a retryA sample is identified by (series, timestamp). Writing the same pair twice with the same value is ignored, so a retry is safe.
Knowing a host went quietRecord an up metric for every scrape (1 or 0), so a dead target creates a 0, not just silence.
💡Why shard by series, not by time
If one series always goes to one ingester, its samples are appended in order into one chunk, which is what makes compression work. Sharding by time would send every series to every writer and kill both compression and the label index.
🎤
Say it out loud
“I would use a local agent that scrapes the host's targets, so a failed scrape is a clear health signal, then pushes compressed batches to stateless gateways, with a push path for short-lived jobs. The agent buffers on disk, so an outage does not lose data. Gateways authenticate and apply limits, then write to a queue partitioned by series hash, so each series lands on one ingester in order, which keeps compression and the index efficient. Ingesters log, keep three copies and acknowledge. The cost is one more system, but it turns a storage outage into a delay instead of a loss.”
5.2

Storage and downsampling: a TSDB, compression and tiers

The problem: We add 600 GB of compressed data a day and must keep years of history, and still answer a 30-day dashboard in seconds. Storing every raw sample forever is impossible, and reading billions of points for a long chart is too slow.

OptionHow it worksGoodBad
A general relational databaseOne row per sample in a table with an index on (series, time).Familiar tools and SQL.Row overhead and index make each sample dozens of bytes, 20 times more than needed, and writes at 5M a second are far beyond a normal database.
A wide-column or key-value storeKey = (series, time bucket), value = a list of samples.Scales out and handles writes well. Easy to shard.Compression is weaker, the label index must be built separately, and aggregate queries are slow without extra work.
A purpose-built TSDB: in-memory head, WAL, immutable compressed blocksWrite to memory and a log. Cut an immutable block every 2 hours with chunks and an index. Compact blocks later.Best compression (about 1.4 bytes a sample), fast ingestion, blocks are easy to cache, replicate, upload and delete.A specialised system to build or run, and memory scales with the number of series.
A columnar warehouseStore metrics in a column format, queried with SQL.Good for analytical queries over huge ranges. Can reuse the warehouse.Slower for the newest data and for many small point lookups. High ingest cost per sample.
Pick
A purpose-built TSDB with a head, a write-ahead log, immutable blocks in object storage, and tiered rollups

The workload is append-only, ordered by time and read as ranges, which is exactly what a TSDB is built for. Samples within one series change little, so storing the delta of the delta of timestamps (usually zero, one bit) and the XOR of the value against the last one (usually few bits) brings a sample from 16 bytes down to about 1.4. That 11-fold saving is the largest cost lever in the whole design.

Immutable blocks make everything else simple: they can be cached, copied to cheap object storage, replicated and deleted whole when they pass retention. We keep three tiers because the cost of keeping raw data grows without bound: raw for 15 days, 5-minute rollups for 13 months, and 1-hour rollups for 5 years. Each rollup bucket stores min, max, sum and count, so averages, rates and extremes still work, but a single sample cannot be recovered. That trade is deliberate.

TierResolutionKeptSize (illustrative)What you can still ask
Raw10 s15 daysabout 9 TB (one copy)Everything, including a single spike
5-minute rollup5 min13 monthsabout 32 TBAverages, sums, extremes and rates for a month-over-month view
1-hour rollup1 h5 yearsabout 12 TBLong trends and capacity planning, not an incident from last year
⚠️What downsampling loses
A rollup can tell you the maximum in an hour, but not when inside the hour, and it cannot rebuild a percentile from averages. Store histogram buckets, not only a mean, if you will want percentiles from old data. Rollups cannot be undone, so choose the aggregates before you delete the raw data.
🎤
Say it out loud
“I would build a purpose-built time-series store. Writes go to an in-memory head with a write-ahead log, and every two hours become an immutable block with chunks and an index. Delta-of-delta timestamps and XOR values bring a sample from 16 bytes to about 1.4, which is the biggest cost saving. Blocks go to object storage, and a compactor merges them. I keep raw for 15 days, 5-minute rollups for 13 months and hourly rollups for 5 years, which is about 53 terabytes instead of over a petabyte. Rollups keep min, max, sum and count, so I say clearly that they cannot give back single samples or rebuild percentiles.”
5.3

Cardinality: the thing that really kills a metrics system

The problem: A series is a unique set of labels, so every new label value makes a new series, and series count multiplies. One deploy that adds a user id or a request id as a label can add millions of series in minutes. Memory, the index, ingest cost and query time all grow with series, and the damage is slow to notice and hard to undo.

OptionHow it worksGoodBad
Do nothing and add capacityLet tenants create any labels they like, and buy more memory when it hurts.No friction for teams.One team can take the platform down for everyone, and the bill grows without a bound.
Hard limits per tenant and per metricCount active series per tenant. Reject new series above the limit and tell the owner which metric grew.A hard guarantee. One tenant cannot break the others.A team can lose new data suddenly. Needs clear errors, alerts before the limit and a way to raise it.
Drop or aggregate labels at the edgeThe agent or gateway removes denied labels (user id, request id, full URL) or replaces them with a fixed set before storage.Stops the problem before it costs anything. Cheap and fast.Needs rules and teamwork, and a dropped label cannot be recovered.
Move high-cardinality detail to logs and tracesKeep metrics for low-cardinality aggregates (service, region, status code) and answer per-user questions from logs or traces.The right tool for each job. Keeps metrics cheap and fast.Teams must learn which system to use, and link between them.
Pick
Hard series limits per tenant, label rules at the edge, cardinality reports, and a clear rule that per-user detail belongs in logs or traces

Volume is easy to pay for; cardinality is what breaks the system, because index memory and query cost grow with the number of series, not with samples. So the defence has to be a hard cap: count active series per tenant (an approximate count from a HyperLogLog sketch is enough), reject new series above the limit, and warn the owner at 80%. The error names the metric that grew, so a team can fix it in minutes.

Prevention is cheaper than rejection. Rules at the edge drop labels that should never be labels (a user id, a request id, a raw URL with an id in it) and a daily report lists the top metrics by series count. The cultural rule is simple: if a label has an unbounded set of values, it belongs in a log or a trace, and the metric keeps only the aggregate.

LabelDistinct valuesVerdict
servicehundredsFine
region, status_code, methodtensFine
pod or container idthousands, and churningCareful: churn creates a new series every deploy
customer idtens of thousandsOnly with a limit, and only for key metrics
user id, request id, session id, raw URLmillions and unboundedNever. Use logs or traces
🧠Churn counts too
A container that restarts every hour with a new id makes a new series each time. The series count is not just what is active now, it is how many distinct series you keep in the index for the retention period. Drop short-lived labels, or aggregate them away.
🎤
Say it out loud
“The real danger is cardinality, not volume. Every distinct label set is a series, so one unbounded label such as a user id multiplies everything and breaks memory and the index. I would enforce a hard series limit per tenant at the gateway, with a warning at 80 percent and an error that names the metric. I would drop denied labels at the edge, publish a daily top-series report, and set the rule that unbounded detail belongs in logs and traces, with only the aggregate kept as a metric. I would also count churn from short-lived container ids, not just the active series.”
5.4

Queries, dashboards and percentiles

The problem: A dashboard refreshes every 30 seconds for thousands of people, each chart touching a hundred series over hours or weeks. Read naively that is billions of samples a second. And the most common thing people ask for, a percentile such as p99 latency, cannot be computed correctly from stored averages or from other percentiles.

OptionHow it worksGoodBad
Query raw data every timeEach refresh reads every raw sample in the range and aggregates it.Simple and exact.About 1.7 billion samples a second for the dashboard load. Long ranges time out.
Query frontend: split, cache and pick a tierCut a long range into per-day parts, cache the finished parts, compute only the newest part, and read a rollup for long ranges.2,880 times less work per refresh. Immutable past data is perfectly cacheable.More moving parts and cache invalidation for late data near the edge.
Precompute with recording rulesCompute expensive aggregates (for example per-service request rate) on a schedule and store them as new series.Dashboards and alerts read a few cheap series instead of thousands.Costs extra series and storage, and you must know the queries in advance.
Averages for latencyStore the mean (or each host's p99) and combine those.Tiny to store.Wrong. Averages hide the slow tail, and you cannot average percentiles into a real percentile.
Pick
A query frontend with splitting, caching and tier selection, recording rules for the hottest queries, and latency stored as mergeable histogram buckets

Most dashboard work is repeated, and most of the data in a long range is already final. The frontend splits a 7-day query into 7 daily parts, answers six of them from a cache, and computes only today. It also picks the tier by range: an hour of data from the raw tier, a month from 5-minute rollups. With step alignment so the same chart reuses the same cache keys, a refresh costs seconds of new data, not days.

For latency, store a histogram: a count of requests in each latency bucket. Buckets from different hosts can simply be added, and the percentile is read from the merged counts. Averaging each host's p99 gives a wrong answer, as the visualizer below shows. A mergeable sketch (t-digest or DDSketch) is the more precise alternative, with a small, bounded error.

QuestionAnswer
Counter reset (a process restarts and its counter drops to 0)A rate() function detects a drop and treats it as a reset, not as a negative rate.
A query that matches 50 million seriesEnforce limits on series, samples and time per query. Reject it with an error that says why, so one query cannot hurt the cluster.
Tail latency of a fan-out queryA query touches many shards, so the slowest one sets the time. Use timeouts, hedged requests and partial results with a warning.
Late data inside a cached partDo not cache the last few minutes. Mark newer parts as incomplete and recompute them.
Which rollup to readThe step decides: if a point is 1 hour wide, read the 1-hour rollup rather than 360 raw points.
💡Try it
Use the visualizer below: raise the number of series, then switch a shard pair in the percentile panel and watch the average of two p99 values miss the true p99.
🎤
Say it out loud
“Dashboards would melt the store if they read raw data, so I would put a query frontend in front. It splits a long range into days, serves the finished days from a cache, computes only the newest part, and chooses a raw or rolled-up tier by range, which is about 2,900 times less work per refresh. For hot queries I add recording rules. For latency I store histogram buckets, because buckets from different hosts can be added and the percentile read from the merged counts, while averaging p99s gives a wrong answer. I also put hard limits on series, samples and time per query.”
5.5

Alerting that you can trust, including when the platform is down

The problem: A million rules must be checked every 30 seconds on fresh data, page the right person once, not fifty times, and keep working when parts of the system are failing. A noisy alert system gets ignored, and a silent one is worse than none. And if the monitoring system itself dies, nobody gets a page about it.

OptionHow it worksGoodBad
One central evaluatorA single process loads all rules and checks them in a loop.Simple. No coordination.A bottleneck at 33,000 evaluations a second, and a single point of failure for all alerting.
Sharded evaluators with HA pairsRule groups are spread over evaluators by hash. Each shard runs on two replicas that both evaluate, and the alert manager deduplicates.Scales out, and no single failure stops alerting. Both replicas fire, so a dead one loses nothing.Twice the read load, and the alert manager must deduplicate. Two replicas can briefly disagree.
Evaluate inside the storage layerRun the rules where the data lives, as a streaming query on the incoming samples.Very fast, and no re-reading of data.Complex. Mixes concerns, and any storage failure hits alerting too.
Rely on a single external serviceSend metrics to a vendor, and let it alert.Little to run.Still needs a watcher for the vendor, and may not fit your cost, privacy or latency needs.
Pick
Sharded evaluators, each on two replicas, with an alert manager for grouping and deduplication, and an independent meta-monitor with a dead man's switch

Spread rule groups across evaluators by hash, and run two replicas of every shard that both evaluate and both send. The alert manager deduplicates by label set, so one real problem is one page. Each alert goes through a small state machine: pending (the condition is true), firing (true for the whole for duration, say 5 minutes, which prevents flapping), then resolved. Evaluators read data slightly older than the ingestion lag, so a late sample does not cause a false alarm.

The hardest question is who watches the watcher. We run a small, independent system on separate infrastructure that checks the platform, plus a dead man's switch: an alert that always fires, sent to an external service that pages us if it ever stops arriving. Silence becomes a signal.

Design choiceWhy
Alert on symptoms (SLO burn rate), not causesUsers feel errors and slowness, not CPU. Burn-rate alerts page when the error budget is being spent too fast, with far fewer false pages.
A for duration on every alertA spike for one scrape is noise. Five minutes of failing is a problem.
Group and inhibitOne broken database should be one page, not 400. Inhibition suppresses child alerts when the parent is firing.
No data is a decisionA rule whose series vanished stays silent unless you also alert on absence. Decide per rule, and use the up metric.
Reliable notificationRetry, fall back to a second channel, and track delivery. A page that never arrived is the same as no alert.
Test rules like codeUnit-test the expressions on sample data and backtest on past incidents before shipping them.
🎤
Say it out loud
“For alerting I would shard rule groups across evaluators by hash and run two replicas of each shard, both evaluating and both sending, with an alert manager that deduplicates, groups and routes. Each alert goes pending, firing, resolved, with a for duration to stop flapping, and evaluators read data a little older than the ingestion lag. I would alert on symptoms using SLO burn rate, not on causes. And the platform must not be its own only watcher: a small independent meta-monitor plus a dead man's switch, an alert that always fires to an external service that pages us if it stops, turns silence into a signal.”
VisualizerCardinality, downsampling and why you cannot average percentilesRaise the hosts and the extra label (a user id with a million values) and watch series, memory and cost explode against the limit. Turn the rollup tiers off to see what they save. Then switch the shard pair and see the average of two p99 values miss the true p99.
An extra label, with this many distinct values (for example a customer, a pod, or a user id)
Series limit
Keep 5-minute rollups for 13 months?
Keep 1-hour rollups for 5 years?
Active series
50M
50M base + 20 from the label
Samples per second
5.0M
series ÷ 10 s
Raw per day
6.9 TB
16 bytes a sample
Compressed per day
605 GB
about 1.4 bytes a sample
Head memory
150 GB
about 3 KB a series, one copy
Inside the limit: 50M series, 5.0M samples a second. Raw samples would be 6.9 TB a day, compression brings that to about 605 GB, and the head block needs about 150 GB of memory (before replicas). Keeping everything for five years would cost 1.1 PB; the tiered plan below keeps 53.2 TB.
What each retention tier costs (one copy, illustrative)
Raw samples, 15 days9.1 TB
605 GB a day compressed
5-minute rollups, 13 months31.9 TB
4 values per 5 minutes per series
1-hour rollups, 5 years12.3 TB
4 values per hour per series
Total kept: 53.2 TB. Raw samples kept for the same five years would be 1.1 PB, which is 20.8 times more. A rollup stores 4 values (min, max, sum, count) per bucket, so it keeps averages and extremes but cannot give back individual samples. At a 10 s scrape a 5-minute bucket replaces 30 samples with 4 values, and a 1-hour bucket replaces 360.
Why you must not average percentiles
Two shards report their own p99. What is the p99 of both together?
Shard A has 1,000 requests and is fast. Shard B has 9,000 and is slower. Latency buckets are upper bounds in ms: 50, 100, 200, 500, 1000.
Bucket (ms)≤50≤100≤200≤500≤1000Requestsp99
Shard A7002909101,000100 ms
Shard B3,0002,0002,9001,010909,000500 ms
Merged buckets3,7002,2902,9091,0119010,000500 ms
Average of the two p99s
300 ms
(100 + 500) ÷ 2
Weighted by requests
460 ms
(100×1000 + 500×9000) ÷ 10000
True p99 (merge buckets first)
500 ms
99% of 10,000 = 9,900th request
Neither average equals the true p99 of 500 ms. Percentiles do not combine. Store histogram buckets (or a mergeable sketch such as t-digest or DDSketch), add the counts across shards, and only then read the percentile. Here the answer is the upper bound of a bucket, so it is approximate; real systems interpolate inside the bucket.

A simplified model with fixed numbers and no random values. Every size here is an illustrative assumption: 16 bytes a raw sample, about 1.4 bytes compressed, about 3 KB of head memory per series, and 4 values per rollup bucket. The extra label is counted as one new series per label value per metric that carries it. Real compression and memory depend on the engine and the data.

Step 6Scale, bottlenecks and failuresabout 7 min

🤔
Pause. Try it yourself first
Run the day. A deploy adds a label with a million values. One ingester dies. A whole zone goes dark. A team's agents send duplicate data. Dashboards are slow at 9am. And what pages you if the whole monitoring system stops?

What breaks first, and the fix

BottleneckFix
Series growth from one bad labelSeries limits per tenant at the gateway, label rules at the edge, a warning at 80%, and a top-series report. The cheapest fix is before storage.
Head memory (150 GB for 50M series, 450 GB with 3 copies)Many ingesters, each holding a slice. Keep blocks short (2 hours) so memory is released, and watch memory per series.
Alert evaluation reads (about 20M samples a second)Recording rules for shared sub-expressions, evaluate on recent data only, and shard evaluators. Flag expensive rules.
Dashboard load at 9amQuery frontend with splitting and a results cache, tier selection, and per-tenant query limits. Recording rules for the busiest charts.
Object storage reads for long rangesRead rollups, cache index and chunk files locally, and compact small blocks into larger ones.
A hot tenant on a few ingestersShard by series hash, not by tenant, and add a per-tenant rate limit and a per-tenant quota on ingesters.
Cross-region queriesEach region keeps its own data. A global query layer fans out and merges, and returns partial results with a warning if a region is slow.

What if a part fails?

FailureHow the design copes
An ingester diesTwo other copies hold its series. The queue replays what it missed, and the WAL restores its head on restart. Queries read the other copies meanwhile.
The network between agents and gateways breaksAgents buffer on disk, then send the backlog with backoff. Old samples inside the accepted window are written, and the rest go to a backfill path.
Object storage is slow or downRecent queries still use the heads. Long-range queries fail with a clear error or partial data, and compaction retries later. No new data is lost.
Storage cannot keep up with writesThe queue grows (lag), and the lag alert fires. Scale ingesters, and shed low-priority tenants if needed. No loss while the queue has room.
A rule evaluator diesIts replica is already evaluating, and the alert manager deduplicates. A new instance takes over the shard and reloads the rule state.
The whole platform is downThe independent meta-monitor and the dead man's switch notice that data stopped, and page the on-call by a path that does not use the platform.
What to monitor
  • •Ingest lag (the age of the oldest unwritten sample) and the queue depth per partition
  • •Active series per tenant and total, and the number of new series per minute
  • •Samples dropped, rejected and rate-limited, by reason and tenant
  • •Alert evaluation duration and missed evaluations, per rule group
  • •Query latency at p50 and p99, cache hit rate, and queries rejected by limits
  • •Notification success rate and the delay from firing to delivery
Security and abuse
  • •Authenticate and authorise every write and query by tenant, and isolate tenants in the data and the cache
  • •Never put secrets or personal data in labels, because labels are visible to anyone who can query
  • •Encrypt data in transit and at rest, and protect the alert channels and their webhook secrets
  • •Limit query cost per tenant so a heavy query is not a denial of service
  • •Audit who changed alert rules, silences and retention, since a silenced alert can hide an outage

Step 7Wrap upabout 3 min

Agents scrape locally, batch and buffer, and push through gateways with limits into a partitioned queue. Ingesters keep the newest data in memory with a write-ahead log, three copies each, and cut immutable compressed blocks every two hours. Blocks are compacted, downsampled into tiers and stored in object storage. A query frontend splits, caches and picks a tier, and percentiles come from mergeable histograms. Sharded evaluators with HA pairs and an alert manager page people, and an independent meta-monitor with a dead man's switch watches the platform. The key risk is cardinality, so we cap series per tenant.

Trade-offs you made

DecisionWhat we gainWhat it costs
A purpose-built TSDB with compressionAbout 1.4 bytes a sample, so 11 times less storage than raw.A specialised system, and memory that grows with series.
Downsampled tiersFive years of history for about 53 TB instead of over 1,000 TB.Old data loses detail and cannot give back single samples.
A queue between gateways and ingestersBursts and storage outages become delay, not loss, and we can replay.Another system to run and a little extra latency.
Hard series limits per tenantOne team cannot take down the platform.A team may be rejected suddenly, so we need warnings and clear errors.
Histogram buckets for latencyPercentiles that merge correctly across hosts.Approximate answers, and many series per histogram.
Two evaluator replicas per shardNo single failure stops alerting.Double the read load and a deduplication step.
If we had more time, we would…
  • •Cross-region and global query: a query layer that fans out to regional clusters and merges.
  • •Exemplars: link a metric point to a trace, so you can jump from a spike to an example request.
  • •Adaptive downsampling: keep more detail around alerts and incidents than in quiet periods.
  • •Anomaly detection and seasonal baselines on top of the stored series.
  • •Cost attribution per team, with budgets and automatic warnings before limits are hit.
🎤
Say it out loud
“To recap: local agents scrape, batch and buffer, and push through gateways with limits into a partitioned queue. Ingesters hold the newest data with a write-ahead log, three copies, and cut immutable compressed blocks that go to object storage with tiered rollups. A query frontend splits and caches, and percentiles come from merged histograms. Sharded evaluator pairs and an alert manager page people, and an independent watcher with a dead man's switch watches the platform. The main trade-offs are compression and rollups for cost against lost detail, and hard series limits for safety against sudden rejections. The biggest risk is cardinality, so I would ship the limits first.”

Q&ACross-questions (25)

💡How to practise
Cover the answer. Say yours out loud in 30 to 60 seconds. Then open the model answer, the follow-up, and the weak answer to see what to avoid. Use Open all at the top for a quick read.
Warm-upProbingCurveballWarm-up = basics. Probing = tests depth. Curveball = changes the problem.

Collecting and writing data

Show that you understand push versus pull, and what five million samples a second really means.

Storage, retention and cardinality

Where cost and correctness live. This is where interviewers separate levels.

Queries and alerting

Reading the data, and being paged correctly.

Curveballs and operations

Where the interviewer changes the problem or asks what you would do on call.

What ifIf the interviewer changes the problem

A change in requirements is a test of whether you understand why your design looks the way it does.

New requirementWhat changes in the design
Sub-second resolution for a few key metricsA separate fast path with short retention for a small set of series, and a high-resolution tier only for them. Cost is proportional to series times rate, so keep the set small.
Logs and traces tooSeparate systems with their own storage, since logs and traces are much larger and indexed differently. Link them to metrics with exemplars and shared labels.
Strict global consistency across regionsNot worth it for monitoring. Prefer regional clusters with a fan-out query layer and regional alerting, so one region failing does not blind the rest.
A customer-facing metrics product (many external tenants)Stronger isolation, per-tenant encryption and quotas, usage billing, a public API, and much tighter limits on cardinality and query cost.
Event or high-cardinality analytics (per user)That is an analytics workload: a columnar store or a log pipeline, not a metrics store. Keep only aggregates in metrics.
Percentiles must be exactKeep raw latencies for a short window, or use a high-precision sketch, and accept a much larger cost. Say what the cost is.
Retention must be 10 years at full resolutionCosts grow linearly. Use cheap object storage tiers, columnar compression and, for compliance data only, a separate archive path.
Only 1,000 hostsA single Prometheus-style server with local disk and one alerting pair is enough. Do not build the distributed version before you need it.

ScoreHow answers are judged

AreaWeakGoodGreat
RequirementsStarts with boxes. Never asks about retention, cardinality or alert latency.Asks about scale, retention, query and alert speed, and writes the scope down.Also asks about push versus pull, tenants, what must survive an outage, and what no data means.
EstimationNo numbers, or only a daily total.Gets series, samples per second and raw storage.Prices compressed bytes per sample, memory per series and each retention tier, and shows alert reads exceed ingest.
DesignOne database that does everything.Agents, a queue, writers, storage, a query layer and an alerting path.Series-hash sharding, head plus WAL plus immutable blocks, a query frontend with caching, and a watcher outside the platform.
Cardinality and correctnessDoes not mention series count. Averages percentiles.Knows what a series is and uses histograms.Caps series per tenant at the edge, counts churn, explains why percentiles do not merge, and says what a rollup loses.
Trade-offsPresents one solution as obviously right.Compares push with pull, and raw with rollups.States the cost of each choice, such as rollups losing detail and hard limits rejecting a team, and says when a simple design is enough.
OperationsNo failure plan.Mentions replication, retries and basic alerts.Plans for a dead ingester, a label explosion, late data and an outage of the monitor itself, with a dead man's switch.

AvoidCommon mistakes on this question

MistakeDo this instead
Treating it as a big-data volume problem and ignoring cardinalityName series count as the main risk, and add hard limits and label rules at the edge.
Storing every raw sample foreverUse compression, retention tiers and rollups, and say what they lose.
Averaging percentiles or storing only means for latencyStore mergeable histogram buckets or sketches, and compute the percentile after merging.
Letting dashboards read raw data on every refreshPut a query frontend with splitting, caching, tier selection and limits in front.
Alerting on causes such as CPU, and with no for durationAlert on symptoms and SLO burn rate, with a for duration, grouping and inhibition.
One evaluator and one alert managerShard evaluators, run replicas, and deduplicate in the alert manager.
No answer for who watches the monitorAdd an independent meta-monitor and a dead man's switch to an external service.
Allowing user ids or request ids as labelsDrop them at the edge and use logs or traces for per-request detail.

Revise60-second revision sheet

  • ✔Scale: 500k hosts × 100 metrics = 50M series, every 10 s = 5M samples a second, 432B a day.
  • ✔Cost: 16 bytes raw, about 1.4 compressed. 6.9 TB a day raw, about 600 GB compressed.
  • ✔Write path: agent buffers, gateway limits, queue by series hash, ingester head + WAL, 3 copies, block every 2 hours.
  • ✔Tiers: raw 15 days, 5-minute rollups 13 months, hourly 5 years. Rollups keep min, max, sum, count.
  • ✔Cardinality: a series is a unique label set. Memory scales with series, so cap them per tenant and drop unbounded labels.
  • ✔Percentiles: never average them. Store histogram buckets or a sketch, merge, then read the percentile.
  • ✔Queries: frontend splits by day, caches the past, picks a tier, and enforces limits.
  • ✔Alerts: sharded evaluators in pairs, pending, firing, resolved, a for duration, alert manager groups and routes.
  • ✔Watch the watcher: an independent meta-monitor and a dead man's switch.
  • ✔One line: “Compress it, tier it, cap the series, merge histograms not percentiles, and make silence a signal.”

Read these topics next

Time Series Databases→

The storage ideas this design builds on: time-ordered, append-only data.

Metrics and Instrumentation→

Counters, gauges and histograms, and what the agents collect.

Alerts and Monitoring→

The alerting basics: symptoms, thresholds and on-call.

SLOs and Error Budgets→

Burn-rate alerts, the best way to page on symptoms.

Kafka Deep Dive→

The partitioned log between gateways and ingesters.

Write-Ahead Log (WAL)→

How the head block survives a crash.

HyperLogLog→

A cheap way to count active series per tenant.

Three Pillars of Observability→

How metrics, logs and traces fit together.

← Previous
Design a Collaborative Editor (Google Docs)
Next →
Design a Distributed Message Queue (Kafka-like)