Migrating Event Streams
By now, a part of your brain should be permanently etched with the phrase, “the event log is immutable.” Events are the sole source of truth, and they cannot be changed. This chapter has made it pretty clear that, if you need to evolve events and commands, you do so by creating new ones because a new version of an event is actually a brand-new event.
A number of frameworks will let you migrate from V1 of an event to V2 “in-place” as the stream is being processed. This doesn’t break the rules so long as the meaning conveyed by the event doesn’t change.
Here lies the controversy. I contend that if you can migrate an event to a new version in-memory during processing, then you should also be able to migrate that event
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access