Interview frequency: …
Short answer
Instead of storing only the current state, the system records every change as an immutable historical event (Append-Only Event) and rebuilds the current state by replaying the event stream.
Explanation
In financial systems and shipment tracking, knowing that an account balance is $500 is not enough; the full history of deposits and withdrawals matters. Event Sourcing provides a complete, tamper-resistant audit trail. Libraries such as Marten (on PostgreSQL) or EventStoreDB provide native event recording and fast read projections (Read Projections).
Code example
// Immutable stored events
public record AccountCreated(Guid Id, string Owner);
public record MoneyDeposited(Guid Id, decimal Amount);
public record MoneyWithdrawn(Guid Id, decimal Amount);Common mistakes
- Editing or deleting previous events in an Event Store; the event log is Immutable forever, and corrections should be new events.