Monday, July 17, 2017

The Ugly of Event Sourcing: Projection Schema Changes

DZone Database Zone
The Ugly of Event Sourcing: Projection Schema Changes

Event sourcing is a beautiful solution for high-performance or complex business systems, but you need to be aware that it also introduces challenges most people don't tell you about. Last year, I blogged about the things I would do differently next time. But after attending another introductory presentation about event sourcing recently, I realized it is time to talk about some real experiences. So in this multi-part post, I will share the good, the bad, and the ugly to prepare you for the road ahead. After having dedicated the last posts on the pains of wrongly designed aggregates, it is time to talk about the ugliness of dealing with projection schema changes.

As I explained in the beginning of this series, projections in event sourcing are a very powerful concept that provides ample opportunities to optimize the performance of your system. However, as far as I'm concerned, they also offer you the most painful challenges. Projections are great if their structure or the way they interpret event streams don't change. But as soon as any of these change, you'll be faced with the problem of increasing rebuild times. The bigger your database becomes, the longer rebuilding will take. And considering the nature of databases, this problem tends to grow non-linearly. Over the years, we've experimented and implemented various solutions to keep this process to a minimum.

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...