Friday, May 18, 2012

Event Sourcing is like Vector Graphics

I want to emphasize at the outset, that I am not an expert in graphics. 
I just have some basic knowledge, but based on that I was able to coin this parallel.

I assume, that you have some basic knowledge about Event Sourcing and CQRS, but if you don't please refer to this definition or watch Greg Young's mindblowing 6,5h long classes (if you already do have some knowledge, watch this video anyway - it is worth your time).
I also assume that you have some very basic knowledge about Vector Graphics and Raster Graphics.

What is an Event? Stop for a moment and think. Probably you will come up with an answer, that an Event is an Aggregate's state change which occurred. And this is a very good answer indeed.
Guess what. Vectors can depict the state change too! So Events may be treated as Vectors, right?

Below I will write down some similarities that Event Sourcing has with Vector Graphics, and 3rd Normal Form databases have with Raster Graphics.

1. Scaling up.
In Vector Graphics you can scale up the image and it won't lose the quality. The same is with Event Sourcing based application - you can easily scale them up without losing the quality of the code and design.
Have you ever scaled up a completely consistent, built on top of 3rd Normal Form database application? It looks just as scaled up Raster Graphics based image - let's just say "ugly". ;)