We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Data Governance Compliance
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Data Governance Compliance
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
2 system design questions lean on this idea. Each walks through the full answer.
One-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
An employee at a healthcare company accesses a celebrity patient's medical record. The media publishes details from that record. The hospital faces a HIPAA investigation. Regulators ask: "Who accessed this record, when, from what device, and what did they view?"
If the hospital has proper audit logging, they can answer in minutes. The log shows: Employee X accessed Patient Y's record at 2:47 PM from IP 10.0.3.14. They viewed diagnosis, medications, and treatment plan. Access was not justified by their role or any active care relationship.
If the hospital doesn't have audit logs, they can't prove anything. The investigation drags on. The fine is larger. The reputational damage is worse.
Audit logging records every significant action in your system: who did what, to what resource, when, from where, and whether it succeeded. It's not optional for regulated industries (healthcare, finance, government). And even for unregulated businesses, audit logs are the first thing you reach for during a security incident, a customer dispute, or a production debugging session where you need to know exactly what sequence of actions led to the current state.
Every audit log entry should capture seven fields:
| Field | What It Records | Example |
|---|---|---|
| timestamp | When the action occurred (UTC, millisecond precision) | 2026-04-03T14:47:23.456Z |
| actor | Who performed the action (user ID, role, service account) | user_id: "usr_abc123", role: "admin" |
| action | What was done (dot-separated verb) | "user.profile.update" |
| resource | What was acted upon (type + ID) | resource_type: "user_profile", resource_id: "usr_xyz789" |
| outcome | Did it succeed or fail? With reason if failed | "success" or "failure: insufficient_permissions" |
| context | Metadata about the request environment | ip_address, user_agent, session_id, request_id |
| changes | What changed (for updates) | before: { email: "old@..." }, after: { email: "new@..." } |
What to audit:
AWS CloudTrail captures about 40 event types per service. Stripe logs every API call with the requesting API key, IP, and key. Your audit surface should be at least this thorough.
It is easy and good
“It is really nice and good Please join the course”