When rebuilding aggregate state from events in Event Sourcing, throwing exceptions on unexpected data can block recovery — especially if compensating events exist downstream in the stream. Since events are immutable facts already validated by business logic, the Apply methods should be lenient and skip or handle anomalies gracefully. Exceptions may be acceptable during early development to catch bugs quickly, but should be removed once compensating operations are introduced. The recommended approach is to validate business rules after state reconstruction rather than during it.

6m read timeFrom event-driven.io
Post cover image