How do you scale Prometheus for long-term storage and high availability (Thanos, Cortex, Mimir)? [Intermediate]
Answer
To scale Prometheus for long-term storage and HA, I run at least two Prometheus replicas per shard, use remote write or sidecars, and query long-term data through systems such as Thanos, Cortex, or Mimir. The exact choice depends on tenancy, scale, and operational model.
Technical explanation
Prometheus itself is single-node per shard, so horizontal scale usually means functional sharding and federation or remote-write architectures.
Thanos adds sidecar upload, object storage, global querying, compaction, and deduplication around Prometheus.
Cortex and Mimir are horizontally scalable, multi-tenant metrics backends designed for remote-write ingestion and large-scale querying.
Hands-on example
Example design: run two Prometheus replicas for each Kubernetes cluster. Remote write to Mimir for 13-month retention. Use Grafana to query Mimir for historical dashboards and local Prometheus for low-latency rule evaluation. Configure replica labels for deduplication.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Observability interview questions
- How does Prometheus storage (TSDB) work, and what is the retention model? [Intermediate]
- What is the difference between Thanos and Cortex/Mimir at a high level? [Intermediate]
- How does Prometheus handle high cardinality, and why is it a problem? [Intermediate]
- How does Prometheus integrate with Kubernetes service discovery? [Intermediate]
- What is the Prometheus Operator, and what are ServiceMonitor and PodMonitor? [Intermediate]
- What is an alerting rule, and how does it differ from a recording rule? [Basic]
- What is a recording rule, and when would you use one? [Basic]
- How do you compute a 95th percentile latency from a histogram in PromQL (histogram_quantile)? [Basic]