Greg Young on CQRS

Tags: Knockout, pubsub, observer, MVC, jQuery, Ajax, EF, Validation, FluentValidation, Visual Studio 2010, ASP.NET, JSON, FullCalendar, Silverlight, Architecture, Vista, IIS, Generics, NHibernate, WCF, RIA Services, Visual Studio 2008, SQL, STORM!, Nullable, ChannelFactory, netTCPBinding, VSPAT, responsive, design, HTML5, CSS3, MVC WebAPI, MVC 4, WebAPI, JQuery Mobile, ScheduleWidget, recurring events, Ninject, Pluggable, CQRS DDD, Windows

When Greg Young's talk on CQRS began I was prepared for a long look at patterns, reliability, transactions, MQs with Azure, WCF, and interface contracts and how Microsoft products were the best way to get you from Point A to Point B. But I was wrong. He showed no code. He didn't mention Azure once. In fact, he didn't talk about specific tooling or tech stacks at all.

What we got was a refreshing reminder that as developers our data-centric approach to modeling and solving business problems is killing us. Young reminded us that state is a first-level derivative of the constant stream of events in the business. (An aside: this is an enduring concept in Buddhism too and the meaning of Heraclitus' dictum that you can never step in the same stream twice.) Simply put: tools and frameworks come and go but the concepts and ideas remain the same. 

Young advised to stop looking at state and start looking at business problems as a series of events that taken together comprise the business process. "Try modeling the full process before the parts of the process." Also, forget the buzzwords. Look at the problem and the process, not "SQL Server" or "Azure Service Bus." To start with the tooling is "developer porn." 

Event messaging has been around for thousands of years. The ancient Sumerians wrote accounting info on clay tablets and baked them. That document stored events in time. Immutable events. In fact, documents are built up of events (think of a passport with its many timestamps).

"Focus on strategic design first."

"There's no such thing as a one-way command." These are called "events." They happened in the real world. They cannot be rolled back. Commands and events are both just messages. We just give them different names.

Overall a fascinating talk because it said nothing new. In fact, I've been evangelizing this way of looking at business problems at my workplace. But this sort of back-to-basics wake up call is exactly what most of us need to hear.