KatInterview

Design a Secure Multi-Region Log Aggregation Pipeline

System DesignModel answer
MediumModel answerSystem Designdistributed-systemssecurityencryption

Last updated

Design a system that collects, encrypts, and stores logs from distributed edge nodes into centralized storage while ensuring confidentiality and integrity.

Problem Statement

You need to design a log aggregation system for a company operating hundreds of distributed edge locations worldwide. The system must collect security and application logs, protect them cryptographically, and store them in a centralized repository for compliance and forensic analysis.

Requirements

Functionality:

  • Ingest structured JSON logs from local collection agents at each edge site
  • Aggregate logs into a centralized, long-term storage system
  • Support querying historical data for audit and investigation purposes

Security:

  • Logs must be encrypted before leaving each edge location
  • The central aggregation infrastructure should not have access to plaintext log data
  • Support periodic cryptographic key updates without service disruption

Performance:

  • Handle aggregate throughput of 500,000 log entries per second across all locations
  • Minimize performance impact on edge applications generating logs

Reliability:

  • Tolerate temporary network failures between edge sites and central infrastructure
  • Detect and report any data loss or tampering

Design Scope

Your design should cover:

  1. Cryptographic architecture: How will you encrypt logs while keeping decryption keys away from the aggregation layer?
  2. System components: Describe the path from log generation to final storage, including intermediate layers
  3. Integrity verification: How will you detect unauthorized modifications or missing data?
  4. Operational concerns: How will the system handle key lifecycle management and maintain low latency?

Assumptions

  • You have access to a distributed coordination service (like etcd or ZooKeeper)
  • Standard protocols and open-source components are preferred
  • Each edge location runs trusted agents, but the network and central systems are untrusted for confidentiality

Hints

Hint 1

Consider using asymmetric encryption so edge nodes only need public keys

Hint 2

Batching and compression before encryption will improve throughput

Hint 3

Chain batches together with hashes to detect gaps and tampering