Event Sourcing
Event Sourcing is a software design pattern where state changes are stored as a sequence of immutable events, rather than just the current state. Instead of updating a record in a database, every change is captured as an event object that is appended to an event log. This allows the system to reconstruct past states by replaying events and provides a complete audit trail of all changes.
Developers should use Event Sourcing when building systems that require strong auditability, temporal querying, or complex business logic with undo/redo capabilities, such as financial applications, e-commerce platforms, or collaborative tools. It is particularly valuable in microservices architectures for maintaining consistency across services and enabling event-driven communication, as it decouples state storage from business logic and supports scalability through event replay.