Suggest an editImprove this articleRefine the answer for “What is event sourcing?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Event sourcing** is an approach to data storage in which the system stores not the current state of an object, but the sequence of all events that led to it; the current state is obtained by replaying the events in order. **Key point:** this makes the system transparent and reproducible, well suited to event-driven architecture, but it requires carefully managing the event stream and the storage.Shown above the full answer for quick recall.Answer (EN)Image**Event sourcing** is an approach to data storage in which the system stores **not the current state of an object, but the sequence of all events** that led to that state. ### The essence Instead of the usual "overwrite the data" model, the system records every change as an event: > "Order created", "Item added", "Order paid". The current state can be obtained by replaying all the events in order. ### Example A regular database stores: ```javascript Order: {id: 1, status: "paid"} ``` Event sourcing stores events: ```javascript 1. OrderCreated 2. ItemAdded 3. PaymentReceived ``` The "paid" state is computed when needed. ### Why this is needed 1. **Full history of changes**: you can precisely reconstruct what happened and when. 2. **Audit and tracing**: suits financial, logistics, and legal systems. 3. **Easy to react to events**: other services can subscribe to them. 4. **Deferred computation**: you can recompute the state when the logic changes. ### Drawbacks - Harder to implement: requires replaying events and building state projections. - Data grows faster. - Not always convenient for simple CRUD applications. **Summary:** > **Event sourcing** stores the history of changes, not the result. > This makes the system transparent, reproducible, and well suited to event-driven architecture, > but it requires carefully managing the event stream and the storage.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.