Saturday, November 1, 2014

I saw Raif Harik give a talk called "selling CQRS to your team or boss" at this year's Code Camp.

This went a little deeper than what was covered in this other talk I saw at the start of the year which touched on CQRS as well. Immutable events are stored in an event store sequentially and incrementally and if you pool the history of a thing you may get a complete picture of it by building up the history of events. I don't really understand how this works without having actually seen the code for a CQRS project though. There was time when I was working at that place I should really stop dwelling on where this guy who I shouldn't mention by name did a project like this and told us all about it and this girl who I also shouldn't mention by name suggested that if you set enough pieces of tracing paper with different shapes upon them on top of each other that together they would add up to a picture and that in such a manner one could have the equivalent of what Eric Evans might consider an object. Everyone at the place I should let go of thought this was a good analogy and I still have this memory because I'm lost in the past. I digress. In terms of how sell CQRS, the argument is that, per force, an application will have more reads than writes and thus we should make it easy to read (minimizing the complicated SQL joins in reporting) and as easy as it is to write. The most interesting thing Mr. Harik said touched on the difference of opinion between Udi Dahan and Greg Young and their two schools of thought. He suggested that Udi Dahan is all about maintaining both normalized and denormalized schemas in CQRS applications while Greg Young would argue that you might as well not even worry about the normalized schema. In an app with only a denormalized schema, reading is easy and for writing one does have to do some painful stuff, but who cares because 80% of the queries, where performance counts, will be of reading. When I think of that conversation from another time that I should just forget about, that guy I shouldn't mention by name seemed to be doing things the Greg Young way. What follows is a chart on what would be more of an Udi Dahan approach to CQRS. It was in one of the slides that Mr. Harik showed off:

No comments:

Post a Comment