Pick the fix
An admin changes a user's role. Where should the audit event be written?
Hint 1 of 1
What if the request fails after the change?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A In the same database transaction as the role change, to an append-only table
Correct. Both happen or neither does.
An audit record must exist if and only if the change happened. Writing it in the same transaction makes that true, and an append-only table means nobody can quietly edit history.
Why not the others?
- B To stdout after the request finishes. Lost if the process dies; easy to drop.
- C Only in the browser console. Not on the server at all.
- D Nowhere; the role table shows the current value. No history of who changed it.