Code[ish]

Event Sourcing and CQRS


Listen Later

Robert Blumen is a DevOps engineer with Salesforce, and he's joined in conversation with Andrzej Ludwikowski, a software architect at SoftwareMill, a Scala development shop. Andrzej is introducing listeners to the concept of event sourcing against the more traditional pattern of CRUD, which stands for create-read-update-delete. CRUD systems are everywhere, and are most typically associated with SQL databases. In comparison, event sourcing is a simply a sequential list of every single action which occurred on a system. Whereas in a database, a row may be updated, erasing the previous data in a column, and event source system would have the old data kept indefinitely, and simply record a new action indicating that the data was updated. In a certain sense, you can get the state of your system at any point in time.

Each architectural pattern has its pros and cons. For one, an event source system can make it easier to track down bugs. If a customer notes an issue an production, rather than pouring through logs, developers can simply "rewind" the state of the application back to some earlier event and see if the faulty behavior is still there. On the flip side, since the event stream is immutable, fixes to previous data needs to be made at the end of the stream. You can modify old events or insert new ones into the flow.

CQRS, or Command Query Responsibility Segregation, builds on top of event sourcing. The idea is to separate the part of the application responsible for handling commands and writes from the part responsible for handling queries and reads. This separation is not only on a software level (different repositories and different deployments), but also on the hardware level ( different hosts and different databases). The motivation for this is to be able to scale each part independently. Maybe your app has more writes than reads, and thus requires different computing power. It allows for a separation of concerns, and can make overall operations more efficient, albeit at a complexity cost. Andrzej is quick to note that event sourcing and CQRS divisions are not necessary for every application. Teams, as always, need to understand how the data flows in their application and which architectural pattern is most efficient for the problems they are trying to solve.

Links from this episode
  • SoftwareMill is a Scala development shop
  • Martin Fowler gives a brief run-down on event sourcing
  • On the SoftwareMill blog, Andrzej has a blog posts on entry-level event sourcing, keeping your domain clean in Event Sourcing, and the best serialization strategy for Event Sourcing
  • CQRS.nu provides more educational resources
  • Andrzej Ludwikowski's web site and talk Event Sourcing: What could go wrong?
...more
View all episodesView all episodes
Download on the App Store

Code[ish]By Heroku from Salesforce

  • 4.7
  • 4.7
  • 4.7
  • 4.7
  • 4.7

4.7

18 ratings


More shows like Code[ish]

View all
TED Radio Hour by NPR

TED Radio Hour

22,003 Listeners

Planet Money by NPR

Planet Money

30,670 Listeners

Global News Podcast by BBC World Service

Global News Podcast

7,681 Listeners

Economist Podcasts by The Economist

Economist Podcasts

4,178 Listeners

This Week in Startups by Jason Calacanis

This Week in Startups

1,283 Listeners

Accidental Tech Podcast by Marco Arment, Casey Liss, John Siracusa

Accidental Tech Podcast

2,126 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

624 Listeners

Science Vs by Spotify Studios

Science Vs

12,196 Listeners

The Salesforce Admins Podcast by Mike Gerholdt

The Salesforce Admins Podcast

205 Listeners

The Daily by The New York Times

The Daily

112,454 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

987 Listeners

The Diary Of A CEO with Steven Bartlett by DOAC

The Diary Of A CEO with Steven Bartlett

8,434 Listeners

Darknet Diaries by Jack Rhysider

Darknet Diaries

7,999 Listeners

All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

All-In with Chamath, Jason, Sacks & Friedberg

9,829 Listeners

Plain English with Derek Thompson by The Ringer

Plain English with Derek Thompson

2,286 Listeners