Imagine a security camera in a bank. It records every single thing that happens — who walked in, who opened which drawer, what was moved, when. You can never erase that footage. It is a permanent record.
An audit table is the database version of that security camera.
It records every important action that happens in a system:
| Action | Example |
|---|---|
| A user sends a notification | notification_sent at 10:23 AM |
| A payment is attempted | payment_attempted for ₹500 |
| A search query is run | search_run for "shoes" |
| A login happens | login_attempted by user u_42 |
Key rule: You can only INSERT new rows into an audit table. You can NEVER UPDATE or DELETE existing rows.
This is what makes it "append-only."