← Back to lessons|architecture
Passkeys not supported in this browser
Event Sourcing over CRUD for Audit Trails
Adopted Event Sourcing over CRUD to maintain complete audit trail with business context for compliance.
lesson_learnedevent-sourcingaudit-trailcompliancekafkapostgrescrud
Created 7/23/2026, 11:02:30 AM
Content
The team decided to move from standard CRUD in PostgreSQL to Event Sourcing with an immutable event log (Kafka) to satisfy compliance requirements for audit trails. Database triggers were considered as an alternative but rejected because they lose business context. Key files: src/services/transactionService.ts (event producers), src/events/eventStore.ts (consumer/store). Reference: Martin Fowler Event Sourcing Pattern article.