DEV Community

Streaming Audio: A Confluent podcast about Apache Kafka®

Intro to Event Sourcing with Apache Kafka ft. Anna McDonald

What is event sourcing and how does it work?

Event sourcing is often used interchangeably with event-driven architecture and event stream processing. However, Anna McDonald (Principal Customer Success Technical Architect, Confluent) explains it's a specific category of its own—an event streaming pattern. 

Anna is passionate about event-driven architectures and event patterns. She’s a tour de force in the Apache Kafka® community and is the presenter of the Event Sourcing and Event Storage with Apache Kafka course on Confluent Developer. In this episode, she previews the course by providing an overview of what event sourcing is and what you need to know in order to build event-driven systems. 

Event sourcing is an architectural design pattern, which defines the approach to handling data operations that are driven by a sequence of events. The pattern ensures that all changes to an application state are captured and stored as an immutable sequence of events, known as a log of events. The events are persisted in an event store, which acts as the system of record. 

Unlike traditional databases where only the latest status is saved, an event-based system saves all events into a database in sequential order. If you find a past event is incorrect, you can replay each event from a certain timestamp up to the present to recreate the latest status of data. 

Event sourcing is commonly implemented with a command query responsibility segregation (CQRS) system to perform data computation tasks in response to events. To implement CQRS with Kafka, you can use Kafka Connect, along with a database, or alternatively use Kafka with the streaming database ksqlDB.

In addition, Anna also shares about:

  • Data at rest and data in motion techniques for event modeling
  • The differences between event streaming and event sourcing
  • How CQRS, change data capture (CDC), and event streaming help you leverage event-driven systems
  • The primary qualities and advantages of an event-based storage system
  • Use cases for event sourcing and how it integrates with your systems


EPISODE LINKS

Episode source