Event Sourcing is a technique to store, process, and analyze a sequence of events that happened in a system, not just the current state of the system. It is mainly useful in Event-Driven architecture or Event-Driven applications to get more benefits, such as the following:
- By replaying events, we can answer any kind of user queries.
- For instance, what is the temperature at a specific hour of a day and how does it come to this state? We can answer this by playing a sequence of events one by one. It is not possible to answer this question if we use a normal data store and store only the current temperature of that day.
- It is easy to know the state of the system at any given point of the time.
- It is easy to support the CQRS pattern. ...