Design a Logging and Data Ingestion System
Accept high-volume log streams, durably buffer them, make recent and historical data queryable, and tail newly arriving records to authorized readers.
Problem statement
For this exercise, assume you are designing a logging and data ingestion system. Accept high-volume log streams, durably buffer them, and make recent and historical data queryable.
Authorized users can also open a resumable live-tail session that streams newly arriving matching records without bypassing the durable ingestion authority.
A slow or disconnected reader must not block producers or exhaust shared buffers, and a resumed session may receive duplicates but must expose a stable cursor so the client can deduplicate.
Define a coherent first production version that satisfies the listed requirements and scale while making failures and degraded behavior visible.
What to build
- Authenticate producers and ingest structured or unstructured log batches.
- Durably buffer, partition, and write logs to searchable recent storage and cheaper archive storage.
- Expose query progress, freshness, and partial-result behavior under backlog.
- An authorized reader can open, resume, and close a filtered live-tail session for newly arriving logs without coupling producer availability to reader speed.
At scale
- For this exercise, assume five million log events per second and ten petabytes retained per month.
- Make accepted logs searchable within 60 seconds p95.
- Retain hot searchable data for seven days and archive data for one year.
- For this exercise, target delivery of newly accepted matching logs to healthy live-tail sessions within two seconds p95, with bounded per-session buffers and resumable cursors.