Event Sourcing for CRUD
We implemented event sourcing for a basic CRUD app because "it's the right way." Spent 6 months on infrastructure instead of features.
The app requirements:
- User management CRUD
- 500 daily users
- No audit requirements
- No time-travel needed
- Standard business logic
What we built:
- Event store (Kafka + PostgreSQL)
- Event replay system
- Projections (read models)
- Snapshotting
- Versioned events
- Saga orchestration
Time spent:
- Infrastructure: 4 months
- Event schema design: 1 month
- Debugging eventual consistency: 1 month
- Actual business features: 2 weeks
What we needed:
class User:
def update(self, data):
self.name = data.name
self.email = data.email
db.save(self)
When event sourcing makes sense:
- Regulatory audit trail requirements
- Financial transactions
- Time-travel debugging
- Complex domain with many state transitions
Lesson: Event sourcing is powerful. It's also expensive. Match complexity to requirements.