System Design/general/Distributed Metrics Logging & Aggregation

Distributed Metrics Logging & Aggregation

EASY15 minDistributed SystemsStorageScalabilityMetricsLoggingStreamingKafkaFlinkParquetTimeseriesData WarehouseElasticsearchEtlSystem Design

Design an observability data platform that accepts high-volume telemetry and supports both recent operational queries and longer-term analysis.

An observability platform serves two very different moments: urgent incident investigation and deliberate historical analysis. This exercise tests whether you can make ingestion, query, retention, and correctness guarantees explicit while controlling the operational and storage cost of a large, uneven telemetry workload.

Problem and Scope

Design a telemetry platform used by engineering teams to collect logs and numerical metrics from a large fleet of services. Teams need recent data quickly enough to investigate incidents, while also retaining selected data for historical analysis. Producers can be bursty, schemas evolve, and parts of the ingestion or storage path may fail without warning. Define the product's query and retention expectations, then explain how the platform remains trustworthy as volume grows.

Define which telemetry types and query patterns matter most before choosing storage or processing technology. Be explicit about freshness, retention, and what data loss or duplication would mean to the engineers using the platform.

Requirements to Clarify

A strong answer should establish scope before choosing components.

Functional requirements:

  • Collect logs and metrics from multiple distributed services and applications
  • Handle different types of data: text logs, structured data, metrics, and unstructured data
  • Process and store data for later retrieval and analysis
  • Support time-based aggregation of metrics data (windowing)
  • Enable search capabilities across logs
  • Allow for data enrichment by joining with existing databases
  • Support analytical querying of the stored data

Non-functional requirements:

  • High throughput - handle massive volumes of incoming data
  • Low latency for data ingestion
  • Scalability - horizontal scaling as data volume grows
  • Durability - ensure no data loss
  • Flexibility - accommodate different data types and formats
  • Cost-effectiveness for long-term storage

Scale and Capacity

Use the workload to justify storage, partitioning, caching, and reliability decisions. Clarify or challenge these assumptions rather than treating them as unquestionable facts:

  • Potentially millions of events per second from distributed services
  • Terabytes of data generated daily
  • Ability to store months or years of historical data
  • Support for bursty traffic patterns

Architecture Discussion

Walk through the important read and write paths, identify ownership boundaries, and explain how the design behaves when dependencies fail. Cover these areas explicitly:

  • Data ingestion layer
  • Message queuing system
  • Stream processing framework
  • Storage systems for different data types
  • Indexing systems for search
  • Query interface for analytics
  • Data aggregation mechanisms
  • Enrichment systems
  • Handling high volume of diverse data types efficiently
  • Balancing between real-time processing and batch processing
  • Choosing appropriate storage systems for different data types
  • Implementing efficient windowing and aggregation for metrics
  • Designing for cost-effective storage while maintaining query performance
  • Managing partitioning and sharding of data
  • Ensuring data consistency and completeness
  • Balancing between write and read optimization

Follow-up Questions

Expect the interviewer to test the consequences of your choices. Practise answering these questions with a concrete decision, its benefit, and its cost:

  • How would your system handle a sudden spike in log volume from one of the services?
    • Focus: Assess the candidate's answer to "How would your system handle a sudden spike in log volume from one of the services" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • What trade-offs did you consider when choosing between real-time processing and batch processing?
    • Focus: Assess the candidate's answer to "What trade-offs did you consider when choosing between real-time processing and batch processing" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • How does your design handle the different storage requirements for metrics versus text logs?
    • Focus: Assess the candidate's answer to "How does your design handle the different storage requirements for metrics versus text logs" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • Could you elaborate on your windowing strategy for time-series data?
    • Focus: Assess the candidate's answer to "Could you elaborate on your windowing strategy for time-series data" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • How would your system ensure data durability while maintaining performance?
    • Focus: Assess the candidate's answer to "How would your system ensure data durability while maintaining performance" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • What approach would you take to optimize query performance for analytical workloads?
    • Focus: Assess the candidate's answer to "What approach would you take to optimize query performance for analytical workloads" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.
  • How would you handle schema evolution for structured data in your system?
    • Focus: Assess the candidate's answer to "How would you handle schema evolution for structured data in your system" for explicit assumptions, a workable mechanism, failure behavior, and consequential trade-offs.

Evaluation Rubric

MockMe evaluates the answer across the following dimensions. A complete answer should connect claims to requirements and explain consequential trade-offs.

  • Requirements and scope (15%): Clarifies and prioritizes the required behavior for Collect logs and metrics from multiple distributed services and applications; Handle different types of data: text logs, structured data, metrics, and unstructured data; Process and store data for later retrieval and analysis. Establishes the constraints that materially affect Distributed Metrics Logging & Aggregation, including High throughput - handle massive volumes of incoming data; Low latency for data ingestion. Strong evidence includes Separates the critical path from secondary features and resolves ambiguous requirements before choosing components.
  • Architecture and interfaces (20%): Presents coherent ownership boundaries and end-to-end flows covering Data ingestion layer; Message queuing system; Stream processing framework; Storage systems for different data types. Strong evidence includes Defines interfaces and traces important success, retry, and failure paths across the proposed components.
  • Data and scaling (25%): Uses workload assumptions such as Potentially millions of events per second from distributed services; Terabytes of data generated daily to justify capacity and partitioning decisions. Explains the data, state, or model strategy for Data ingestion layer; Stream processing framework; Storage systems for different data types. Strong evidence includes Quantifies a dominant workload, identifies the first bottleneck, and explains how the design evolves as that workload grows.
  • Reliability, correctness, and safety (20%): Explains concrete failure behavior, recovery, and operational safeguards for Ensuring data consistency and completeness; Durability - ensure no data loss. Strong evidence includes States the required correctness or consistency boundary and covers retries, partial failure, observability, and safe degradation.
  • Communication and trade-offs (20%): Drives a structured discussion and compares consequential alternatives for Managing partitioning and sharding of data; Ensuring data consistency and completeness; Balancing between write and read optimization. Strong evidence includes Makes assumptions explicit, answers the question asked, and explains both the benefit and cost of major decisions.

Ready to practice this question?

Run a mock system design interview with AI coaching and detailed feedback.