Suggest an editImprove this articleRefine the answer for “What does "event sourcing" mean?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Event Sourcing** is an architectural approach in which the system does not store an object's current state directly, but stores all the events that led to it; the current state is obtained by replaying the events in order. **Key point:** this gives a full history of changes, easy rollback, and natural integration with event-driven architecture (EDA), though it makes storing and reading data harder.Shown above the full answer for quick recall.Answer (EN)Image**Event Sourcing** is an architectural approach in which the system does not store an object's current state directly, but stores **all the events that led to it**. ### The essence Every data change is recorded as an event: > "Order created", "Item added", "Payment received". To get the current state, the system simply replays all the events in order. This way, the database becomes a history log rather than a snapshot of the current state. ### Example The usual approach stores: ```javascript Order: {id: 1, status: "paid"} ``` Event Sourcing stores: ```javascript 1. OrderCreated 2. ItemAdded 3. PaymentReceived ``` From these events, the order's current state can be recomputed at any moment. ### Why this is needed - **Full history of changes:** convenient for auditing and analytics. - **Easy rollback and state replay.** - **Natural integration with event-driven architecture (EDA).** - **Flexibility:** data can be recomputed if the business rules change. ### Drawbacks - Makes storing and reading data harder (you need "projections" for fast queries). - Harder to implement transactional integrity. **Summary:** > **Event Sourcing** is a way of storing not the result but the **history of events**, > letting you precisely restore the past and flexibly manage the system's state.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.