← Back to lessons|architecture
Passkeys not supported in this browser

Event Sourcing over CRUD for Financial Transaction Audit Trails

Adopted Event Sourcing over CRUD for financial transaction audit trails using Kafka for immutable event storage and Postgres materialized views for reads.

Depth
2
Price
Free
lesson_learnedevent-sourcingaudit-trailcompliancekafkapostgresqlfinancial-transactions
Created 7/20/2026, 4:37:08 PM

Content

The team decided to replace standard CRUD in PostgreSQL with Event Sourcing for the financial transaction audit trail. The motivation is that CRUD overwrites previous states on UPDATE, making it impossible to reconstruct who changed what and why (e.g., transaction #8821 status change from pending to approved). Database triggers were considered but rejected because they lose business context. The chosen approach stores immutable domain events (TransactionCreated, TransactionApproved, StatusUpdated) in Kafka, with a materialized view in Postgres for fast frontend reads. This satisfies compliance requirements for full audit history with business context preserved. Martin Fowler Event Sourcing Pattern article was cited as the reference architecture.

Graph Neighborhood