The Power of Event Sourcing: Travel Through Your Application's History

TLDREvent sourcing allows you to time travel through your application's history, maintaining a full audit log of every event. By storing facts about things that have happened, event sourcing enables easy calculation of current and past states. It also provides valuable information for analytics and solves concurrency problems. With event sourcing, you can separate reading and writing concerns, making it a powerful technique to consider in tandem with CQRS and DDD.

Key insights

Event sourcing enables time travel through an application's history, maintaining an audit log of events.

📊By analyzing the sequence of events, event sourcing provides valuable information for analytics and metrics.

🔐Event sourcing solves concurrency problems by allowing multiple processes to modify data simultaneously.

💡Event sourcing separates reading and writing concerns, making it compatible with CQRS and DDD.

🔄Event sourcing stores events as a full audit log, allowing the rebuilding of current and past states.

Q&A

What is event sourcing?

Event sourcing is a technique where each change to an application's state is stored as an event, creating a full audit log.

What are the benefits of event sourcing?

Event sourcing provides time-travel capabilities, analytics information, concurrency solutions, and compatibility with CQRS and DDD.

How does event sourcing solve concurrency problems?

Event sourcing allows concurrent processes to modify data without conflicts by adding new events instead of modifying existing state.

Is event sourcing compatible with other architectural patterns?

Yes, event sourcing is commonly used alongside CQRS and DDD, as it separates reading and writing concerns.

Does event sourcing require rebuilding the current state from events?

Event sourcing can use pre-computed snapshots to optimize state retrieval, but rebuilding from events is always possible.

Timestamped Summary

00:00Event sourcing allows time travel through an application's history and maintains an audit log of events.

01:35Event sourcing provides valuable information for analytics and metrics.

04:07Event sourcing solves concurrency problems by allowing concurrent processes to modify data.

04:38Event sourcing can be combined with CQRS and DDD, as it separates reading and writing concerns.