KatInterview

Design a High-Throughput Telemetry Collection Platform

System DesignModel answer
MediumModel answerSystem Designtime-seriesdistributed-systemsstreaming

Last updated

Build a system to aggregate and store operational telemetry from a large distributed fleet, supporting real-time writes and historical analytics.

Problem

You're building a centralized observability platform for a cloud environment running tens of thousands of services across many data centers. The system must continuously collect operational telemetry—CPU utilization, memory pressure, API response times, failure rates—from all running processes and infrastructure components, then make this data available for real-time monitoring and historical analysis.

Design this telemetry aggregation and query platform with an emphasis on the collection pipeline, write throughput, storage strategy, and keeping heavy analytical queries from interfering with data ingestion.

What You Need to Support

Core Capabilities

  • Data Collection: Accept timestamped numeric observations tagged with arbitrary key-value metadata (e.g., hostname, service_name, region).
  • Client Integration: Provide a lightweight reporting mechanism that applications and operating systems can use without blocking or consuming significant resources.
  • Analytics: Enable time-range queries with filtering by tags, statistical aggregations (mean, max, 95th percentile), and grouping.
  • Lifecycle Management: Keep fine-grained raw observations for short-term debugging, then transition to summarized views for capacity planning and trend analysis over months or years.

Operational Targets

  • Reliability: The ingestion path should remain available through most failures. Data loss should be rare and observable when it occurs.
  • Write Optimization: The architecture should favor write throughput. Read-heavy analytics workloads must not starve the write pipeline.
  • Growth: Adding more hosts or services should scale linearly without architectural changes.

Scale Context

  • Deployment Size: 100,000 compute instances (physical servers, VMs, containers).
  • Data Rate: Each instance emits roughly 50 distinct measurements every 10 seconds, yielding approximately 500,000 observations per second on average, with peaks reaching 1,000,000 per second.
  • Storage Tiers: Full-resolution data retained for 7 days; minute-level summaries for 30 days; hourly summaries for 1 year.
  • Query Performance: Dashboard queries covering the past 6 hours should complete in under 500ms at the 95th percentile.

What to Cover

Your design should address:

  1. Client Strategy: How instances report data—push versus pull, local buffering, dealing with backpressure, and resource isolation.
  2. Ingestion Pipeline: Load distribution, durable buffering, and storage write path.
  3. Storage Design: How to organize telemetry for efficient writes and queries; sharding and partitioning strategies.
  4. Isolation: Architectural techniques to prevent query load from degrading ingestion throughput.

Hints

Hint 1

Consider how to batch and compress observations on the client to reduce network overhead and request volume.

Hint 2

A durable message queue between ingestion frontends and storage can decouple reliability concerns and allow independent scaling.

Hint 3

Time-series databases often partition data both by metric identity and by time window; each choice has different trade-offs for write distribution and query fan-out.