← Back to lessons|architecture
Passkeys not supported in this browser
Event Sourcing over CRUD for Audit Trail Compliance
Adopted Event Sourcing with Kafka for immutable audit trail replacing PostgreSQL CRUD to meet compliance requirements.
lesson_learnedevent-sourcingaudit-trailcompliancekafkapostgresql
Created 7/25/2026, 11:02:32 PM
Content
The team decided to adopt Event Sourcing over traditional CRUD in PostgreSQL for financial transaction audit trails. Compliance required full change history with business context. Database triggers were considered but rejected as they lose business intent. Kafka stores immutable domain events; a materialized view in Postgres serves fast reads. Reference: Martin Fowler Event Sourcing Pattern. Implementation in src/services/transactionService.ts and src/events/eventStore.ts.