Demystifying Event Sourcing and Event-Driven Architecture

TLDREvent sourcing and event-driven architecture are often conflated, but they serve different purposes. Event sourcing is about using events as state, while event-driven architecture is about using events to communicate between service boundaries.

Key insights

🔑Event sourcing is about recording state using a series of events for a unique aggregate.

🌟Event-driven architecture is about using events to communicate with other service boundaries.

🧩Event sourcing and event-driven architecture can be used together or independently, depending on the needs of the system.

💡Event sourcing is not always the best choice, especially for simple CRUD operations.

🚀Choosing between event sourcing and event-driven architecture depends on the stability of business concepts and the need for capturing historical state.

Q&A

What is the difference between event sourcing and event-driven architecture?

Event sourcing is about recording state using events, while event-driven architecture is about using events to communicate between services.

Can event sourcing and event-driven architecture be used together?

Yes, event sourcing and event-driven architecture can be used together or independently, depending on the needs of the system.

When should I use event sourcing?

Event sourcing is best suited for capturing historical state and keeping a full audit log of events in a system.

Is event sourcing always the best choice?

No, event sourcing is not always the best choice, especially for simple CRUD operations where traditional data storage may be more suitable.

How do I choose between event sourcing and event-driven architecture?

Choosing between event sourcing and event-driven architecture depends on the stability of business concepts, the need for capturing historical state, and the complexity of the system.

Timestamped Summary

00:00In this video, Derek Martin explains the differences between event sourcing and event-driven architecture.

01:30Event sourcing is about recording state using events, while event-driven architecture is about using events to communicate between services.

04:19Event sourcing is not always the best choice, especially for simple CRUD operations.

08:33Choosing between event sourcing and event-driven architecture depends on the stability of business concepts and the need for capturing historical state.