You need to keep audit logs for 7 years for compliance, but only query them rarely. Design storage.
IntermediateScenarioLogging Pipelines
Answer
Situation read → Long retention, rare access, must be tamper-evident. Hot search clusters are the wrong place.
What I'd do →
- Route audit events to a separate stream from application logs.
- Write to object storage (S3) with Object Lock in compliance mode and a lifecycle to Glacier Deep Archive after 90 days.
- Store in compressed, partitioned format (e.g.
s3://audit/year=2026/month=03/) as JSON or Parquet. - Query on demand with Athena or load into a temporary cluster.
- Restrict IAM access and log access with CloudTrail data events.
Why → Object storage is cheap and durable; Object Lock gives immutability auditors accept.
Interview tip → Separate "searchable now" from "retained for compliance"; they have different SLAs.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerLoki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?IntermediateFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateThe Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?AdvancedFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?Intermediate