Diagrammatic

System to Collect Performance Metrics from Thousands of Servers — System Design Interview Practice

Design a distributed system to collect, aggregate, and monitor performance metrics from thousands of servers. Work through the requirements, architecture trade-offs, and an interactive design review.

Concepts and architecture decisions to consider

  • monitoringConcept to explore
  • metricsConcept to explore
  • time seriesConcept to explore
  • distributed systemsConcept to explore
  • performanceConcept to explore

Interview prompt

Design Design a distributed system to collect, aggregate, and monitor performance metrics from thousands of servers. so users can Collect metrics from thousands of servers reliably at scale.

  • Define the source of truth for Collect metrics from thousands of servers; Support CPU, memory, disk, network metrics and make retries idempotent.
  • Use bounded, partitioned state to meet Handle billions of data points per day and Low overhead on monitored servers.
  • Separate the critical request path from Agent-based metric collection, Time-series database (InfluxDB, Prometheus), Data aggregation pipeline.
  • Explain consistency, failure recovery, authorization, observability, and a degraded mode.

Requirements and scale assumptions

  • Support the core workflow to Collect metrics from thousands of servers.
  • Expose status, results, and freshness appropriate to Design a distributed system to collect, aggregate, and monitor performance metrics from thousands of servers..
  • Support authorization, validation, updates, deletion, and recovery semantics.
  • Meet Low overhead on monitored servers under normal load.
  • Scale to Handle billions of data points per day without a single hot key or unbounded synchronous work.
  • Do not lose committed state; make retries and duplicate events safe.
  • Degrade safely when downstream workers, caches, or external dependencies fail.
  • Handle billions of data points per day
  • Partition by the primary tenant, user, item, or geographic key and isolate hot partitions.
  • Keep serving state bounded; retain raw events or durable records for replay and auditing.
  • Peak scale: Handle billions of data points per day — Capacity assumption that drives partitioning and backpressure.
  • Latency target: Low overhead on monitored servers — User-facing budget for the primary request or read path.
  • Durable boundary: Committed before async — The source of truth is Collect metrics from thousands of servers; Support CPU, memory, disk, network metrics.
  • Async boundary: At-least-once workers — Keep Agent-based metric collection, Time-series database (InfluxDB, Prometheus), Data aggregation pipeline off the synchronous path.

Key entities

  • SourcePartitionsourceId, partitionId, cursor, schemaVersion, watermark, status

    Replayable system to collect performance metrics from thousands of servers source evidence and ingestion cursor.

  • SchemaVersiondatasetId, version, compatibility, owner, effectiveAt, status

    Governed system to collect performance metrics from thousands of servers contract used to validate producers and consumers.

  • ProcessingRunrunId, inputWatermark, checkpoint, qualityStatus, codeVersion, status

    Checkpointed system to collect performance metrics from thousands of servers processing attempt with quality and lineage metadata.

  • AnalyticalDatasetdatasetId, partition, watermark, schemaVersion, qualityStatus, location

    Curated system to collect performance metrics from thousands of servers serving partition with freshness and quality state.

Data flow

  1. 1. Register sources and contractsThe system to collect performance metrics from thousands of servers catalog records owners, schemas, compatibility rules, retention, lineage, and partitioning before data is accepted.
  2. 2. Ingest with backpressureConnectors checkpoint system to collect performance metrics from thousands of servers source cursors, validate schema and deduplication keys, and slow producers when downstream capacity is exhausted.
  3. 3. Process event time with checkpointsStream or batch engines compute system to collect performance metrics from thousands of servers transformations using watermarks, late-data policy, state checkpoints, and deterministic code versions.
  4. 4. Publish quality-gated datasetsOnly system to collect performance metrics from thousands of servers outputs that pass completeness, freshness, validity, and privacy checks become visible to analytical consumers.
  5. 5. Serve, replay, and reconcileConsumers read bounded partitions with freshness metadata while operators replay failed system to collect performance metrics from thousands of servers ranges and compare output checksums.

Deep dives and trade-offs

  • Schema evolution and data qualityVersion system to collect performance metrics from thousands of servers contracts and make compatibility rules explicit for every producer and consumer. Quarantine malformed partitions instead of poisoning the whole dataset. Track row counts, null rates, duplicates, distribution changes, and policy violations by partition.
  • Watermarks, late data, and exactly-once effectsUse source cursors and event-time watermarks for system to collect performance metrics from thousands of servers progress, not wall-clock assumptions. Make checkpoints, output keys, and sink commits retry-safe under at-least-once delivery. Document how late events revise windows, aggregates, or snapshots.
  • Replay, lineage, and costKeep immutable system to collect performance metrics from thousands of servers raw evidence and code or schema versions so failed outputs can be reproduced. Separate hot serving storage from cold retention and cap replay concurrency. Measure freshness, backlog, compute cost, storage growth, and quality-gate failure rate.
  • Streaming versus batchUse streaming for freshness-critical system to collect performance metrics from thousands of servers paths and batch for backfills, compaction, and expensive recomputation. Forcing every workload into streaming makes state, replay, and cost harder to operate.
  • Raw retention versus curated-only storageRetain enough immutable raw evidence for replay, audit, and correction, then tier or expire it according to policy. Without raw evidence, a bad transformation can require an unreproducible emergency fix.
  • Central warehouse versus domain-owned datasetsCentralize governance and discovery while letting domain owners own contracts and quality signals. A single team owning every transformation becomes a delivery bottleneck and hides data ownership.
Diagrammatic — system design practice and architecture review.