HLDArena
HLD-113·Messaging & Queues
Easy · 500 pts

Immutable Enterprise Compliance Audit Log Sink

Design an append-only compliance audit trail pipeline capturing administrative actions across SaaS tenants and serving recent security log queries.

Max p99
≤ 80 ms
Availability
≥ 99.5%
Budget
≤ $2,350

Functional Requirements

  • FR-1POST /audit/{org_id}/events — Durably accepts structured security audit events without blocking callers.
  • FR-2GET /audit/{org_id}/events — Queries recent tenant audit entries for admin security consoles.
  • FR-3Retention & Lifecycle (org_id) — Enforces TTL retention windows, deduplication, or archival compaction without blocking live reads or writes.
  • FR-4Must buffer batch audit floods and survive a primary database crash without losing accepted logs.

Workload Profile

Baseline Load5,000 Query Read RPS / 10,000 Audit Write RPS
Batch Sync Flood14,000 Read RPS / 32,000 Write RPS
Active Working Set10 GB hot 7-day tenant audit index
Traffic DistributionWrite-heavy burst from large enterprise org_id tenants

Consistency Model

Asynchronous indexing (< 5s query lag) acceptable; accepted audit records must not be dropped.

Design Write-up
0 boxes · 0 edges
0 words
Hidden Cases #4–#7 run automatically on Submit
Case 1: Smoke & API ContractInput Workload
Read RPS
500 rps
Write RPS
400 rps
Key Distribution
Uniform (Low Skew)
Chaos Fault
None (Healthy Cluster)
Expected Pass CriteriaASSERTIONS
• Tail Latency: p99 ≤ 160 ms
• Availability: ≥ 99.5%
Valid end-to-end Client → Compute → Storage topology