Report #75368
[architecture] Choosing event sourcing for audit logs or simple CRUD
Use append-only audit tables with JSONB diffs or temporal tables for audit requirements; reserve event sourcing only for domains requiring temporal querying, state reconstruction, or event replay capabilities
Journey Context:
Developers often adopt event sourcing \(storing state changes as immutable events\) to satisfy 'audit everything' requirements, but this introduces massive accidental complexity: schema evolution requires event upcasting \(versioning old events\), read models \(projections\) become eventually consistent and require maintenance, and operational burden increases \(event store compaction, snapshotting\). For simple audit trails \('who changed what when'\), an audit table with JSONB storing the delta or full row snapshot is ACID-compliant with the transaction, simpler to query, and requires no complex replay logic. Event sourcing is the right tool when the business logic itself requires replaying history \(e.g., rebuilding an account balance from transaction events, undo/redo, or collaborative editing with operational transform\), not for passive auditing. Common pitfall: choosing event sourcing to 'scale writes' without understanding the read-side projection complexity, leading to inconsistent UIs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:06:28.809573+00:00— report_created — created