<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CQRS &#8211; Event Versioning</title>
	<atom:link href="http://elegantcode.com/2010/02/09/cqrs-event-versioning/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cqrs-event-versioning</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 23:42:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: dokie</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-2/#comment-54015</link>
		<dc:creator>dokie</dc:creator>
		<pubDate>Thu, 25 Feb 2010 17:22:04 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-54015</guid>
		<description>&lt;a href=&quot;#comment-53970&quot; rel=&quot;nofollow&quot;&gt;@Mark Nijhof&lt;/a&gt; 
Do you mean the version number of the reconstructed AR is compared to the version number in the store on point of save? This stops a group of cases where that wondow for concurrency error is (usually) small. How does this help with the scenario where the command received would overwrite the previously written AR which may have also been valis - e.g. If 2 users change the address but to different values (ignore why that might happen for now) then depending on whose Command gets there last, their changes will win since the Command does not carry any version information over from the Query side.

I may also be confused by your reply though so apologies if so and would appreciate a clearer explanation.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53970" rel="nofollow">@Mark Nijhof</a><br />
Do you mean the version number of the reconstructed AR is compared to the version number in the store on point of save? This stops a group of cases where that wondow for concurrency error is (usually) small. How does this help with the scenario where the command received would overwrite the previously written AR which may have also been valis &#8211; e.g. If 2 users change the address but to different values (ignore why that might happen for now) then depending on whose Command gets there last, their changes will win since the Command does not carry any version information over from the Query side.</p>
<p>I may also be confused by your reply though so apologies if so and would appreciate a clearer explanation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-2/#comment-53970</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Tue, 23 Feb 2010 14:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53970</guid>
		<description>&lt;a href=&quot;#comment-53969&quot; rel=&quot;nofollow&quot;&gt;@Sebastian&lt;/a&gt; 
Concurrency issues are dealt with by verifying the version numbers of the AR in the event store and the AR you have. If they do not match then you have a concurrency valuation. Now because we work with commands and events we can (if you handle this smartly) automatically solve some of these issues. For example if these two different commands result in different state changes then we could allow the version conflict to be ignored. Greg is going to write a post about this as well, and I am planning on creating a test case where this becomes visible.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53969" rel="nofollow">@Sebastian</a><br />
Concurrency issues are dealt with by verifying the version numbers of the AR in the event store and the AR you have. If they do not match then you have a concurrency valuation. Now because we work with commands and events we can (if you handle this smartly) automatically solve some of these issues. For example if these two different commands result in different state changes then we could allow the version conflict to be ignored. Greg is going to write a post about this as well, and I am planning on creating a test case where this becomes visible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53969</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Tue, 23 Feb 2010 13:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53969</guid>
		<description>Hi mark, 

Thanks for your response. I would really appreciate to get clarified how to deal concurrency issues in CQRS when not using RDMS as the event storage mechanism since I still see this field in color grey :)
Thanks for your blog and for takin down everything to code examples, that really makes things understandable and gives a clear picture of the whole.

Cheers.</description>
		<content:encoded><![CDATA[<p>Hi mark, </p>
<p>Thanks for your response. I would really appreciate to get clarified how to deal concurrency issues in CQRS when not using RDMS as the event storage mechanism since I still see this field in color grey <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks for your blog and for takin down everything to code examples, that really makes things understandable and gives a clear picture of the whole.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53955</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Mon, 22 Feb 2010 18:58:03 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53955</guid>
		<description>&lt;a href=&quot;#comment-53953&quot; rel=&quot;nofollow&quot;&gt;@Sebastian&lt;/a&gt; 
I used adding a property to the event as a simple example, and in this case you might be right it doesn&#039;t need a new event, except if you want to track these things as well. But I am sure there are many more ways these things evolve during the lifetime of a system. Versioning the events this way is a good way of dealing with these changes.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53953" rel="nofollow">@Sebastian</a><br />
I used adding a property to the event as a simple example, and in this case you might be right it doesn&#8217;t need a new event, except if you want to track these things as well. But I am sure there are many more ways these things evolve during the lifetime of a system. Versioning the events this way is a good way of dealing with these changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53953</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Mon, 22 Feb 2010 18:33:01 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53953</guid>
		<description>Hi Mark, 

As long we add data to events we agree we have to reflect that as a new property in the AR. I don&#039;t see any conflict for the case of appending data to events since the new property will be Null until set. So why the need to create versioned events instead of appending new properties to the same event class? 
On the other hand, if we design an event to hold 3 attributes and after system usage we got a requeriment to delete 1... we do will have to change code where that deleted property where set (in the AR), however we might leave the event with those 3 atributes where 1 of those would be redundant and will no afect the AR behaviour since no longer will be reflected into the AR. 
However for this case, of deleting attributes I do see the benefit of &quot;prunning&quot; or &quot;clearing&quot; events using converters but I don&#039;t achieve to see the benefit for the reverse case of appending data to events.
Cheers.</description>
		<content:encoded><![CDATA[<p>Hi Mark, </p>
<p>As long we add data to events we agree we have to reflect that as a new property in the AR. I don&#8217;t see any conflict for the case of appending data to events since the new property will be Null until set. So why the need to create versioned events instead of appending new properties to the same event class?<br />
On the other hand, if we design an event to hold 3 attributes and after system usage we got a requeriment to delete 1&#8230; we do will have to change code where that deleted property where set (in the AR), however we might leave the event with those 3 atributes where 1 of those would be redundant and will no afect the AR behaviour since no longer will be reflected into the AR.<br />
However for this case, of deleting attributes I do see the benefit of &#8220;prunning&#8221; or &#8220;clearing&#8221; events using converters but I don&#8217;t achieve to see the benefit for the reverse case of appending data to events.<br />
Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53945</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Mon, 22 Feb 2010 09:58:37 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53945</guid>
		<description>&lt;a href=&quot;#comment-53944&quot; rel=&quot;nofollow&quot;&gt;@Kaarel&lt;/a&gt; 
That is an interesting issue! And the obvious answer is &quot;it depends&quot; :)

But do you want to keep track of the CC# meaning like Amazon to enable fast purchases? Then you just need it in the reporting database, and deleting from there is a non-issue. But in-order to get it there you need to fire of an event. So I would suggest adding an attribute on the event that indicates the event store to skip storing this event. Because the rule is that you don&#039;t touch events once they are in the event store.

Now if you are forced to do change your events in the event store by law, then you don&#039;t have a choice, in that case I would just go in and just change the CC# within those events, so all other information stays intact and you still keep track of what happened when. But it is not optimal, and you would have the same issue with other auditing solutions.

So if upfront you know something like this is a requirement then I would opt for skipping these events, also I would want them to be containing only the absolute minimum needed information, or perhaps even double sent the event one with CC# and one without, with CC# will not be stored, without will be.

But this is just me thinking about it, all situations are different.

Hope that helps</description>
		<content:encoded><![CDATA[<p><a href="#comment-53944" rel="nofollow">@Kaarel</a><br />
That is an interesting issue! And the obvious answer is &#8220;it depends&#8221; <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But do you want to keep track of the CC# meaning like Amazon to enable fast purchases? Then you just need it in the reporting database, and deleting from there is a non-issue. But in-order to get it there you need to fire of an event. So I would suggest adding an attribute on the event that indicates the event store to skip storing this event. Because the rule is that you don&#8217;t touch events once they are in the event store.</p>
<p>Now if you are forced to do change your events in the event store by law, then you don&#8217;t have a choice, in that case I would just go in and just change the CC# within those events, so all other information stays intact and you still keep track of what happened when. But it is not optimal, and you would have the same issue with other auditing solutions.</p>
<p>So if upfront you know something like this is a requirement then I would opt for skipping these events, also I would want them to be containing only the absolute minimum needed information, or perhaps even double sent the event one with CC# and one without, with CC# will not be stored, without will be.</p>
<p>But this is just me thinking about it, all situations are different.</p>
<p>Hope that helps</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaarel</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53944</link>
		<dc:creator>Kaarel</dc:creator>
		<pubDate>Mon, 22 Feb 2010 09:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53944</guid>
		<description>How do you handle sensitive data when using event sourcing? Do you store credit card numbers in the event log? What if you have to delete all data related to an entity? Say to comply with data protection rules or court order and you have to remove all historical data for some entities (but not all) in your system. Wouldn&#039;t that mess up your event log and auditing?</description>
		<content:encoded><![CDATA[<p>How do you handle sensitive data when using event sourcing? Do you store credit card numbers in the event log? What if you have to delete all data related to an entity? Say to comply with data protection rules or court order and you have to remove all historical data for some entities (but not all) in your system. Wouldn&#8217;t that mess up your event log and auditing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nijhof</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53882</link>
		<dc:creator>Mark Nijhof</dc:creator>
		<pubDate>Fri, 19 Feb 2010 20:07:25 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53882</guid>
		<description>&lt;a href=&quot;#comment-53881&quot; rel=&quot;nofollow&quot;&gt;@Chad&lt;/a&gt; 
You keep the events because they offer business value, either in the ability to gather more information from your data, or as an audit log. If you would go and start changing these historical events you introduce the possibility that you make a mistake. And your audit log becomes invalid. So depending on how important those features are for you you might decide to &#039;break the rules&#039;.

But before you do; once you have a mechanism to convert events from one version to an other version this becomes easy. You can also issue one time compensating events if you run into a change that you cannot manage naturally. So I would like to argue that it is not very difficult, and that changing existing events might introduce more pain than you may gain.

The binary formatter indeed means that you need to keep the events in the same namespace, but that is only one way of serializing, I recommend creating a custom formatter disconnecting yourself from the namespace issue and also increasing speed and minimizing space. And consider using an other medium to store the events, like using CouchDB or something like that.

But to answer your last question, I wouldn&#039;t go into the historical events and change them, I rather version them and deal with that issue.</description>
		<content:encoded><![CDATA[<p><a href="#comment-53881" rel="nofollow">@Chad</a><br />
You keep the events because they offer business value, either in the ability to gather more information from your data, or as an audit log. If you would go and start changing these historical events you introduce the possibility that you make a mistake. And your audit log becomes invalid. So depending on how important those features are for you you might decide to &#8216;break the rules&#8217;.</p>
<p>But before you do; once you have a mechanism to convert events from one version to an other version this becomes easy. You can also issue one time compensating events if you run into a change that you cannot manage naturally. So I would like to argue that it is not very difficult, and that changing existing events might introduce more pain than you may gain.</p>
<p>The binary formatter indeed means that you need to keep the events in the same namespace, but that is only one way of serializing, I recommend creating a custom formatter disconnecting yourself from the namespace issue and also increasing speed and minimizing space. And consider using an other medium to store the events, like using CouchDB or something like that.</p>
<p>But to answer your last question, I wouldn&#8217;t go into the historical events and change them, I rather version them and deal with that issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53881</link>
		<dc:creator>Chad</dc:creator>
		<pubDate>Fri, 19 Feb 2010 19:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53881</guid>
		<description>I can see how a method like this would work well for simple changes like the one you described. But how would you handle big changes?

For instance, say that we do a big refactor and we rename/move/merge/split some of our events. Having to keep those &quot;old&quot; events around along with the newly refactored events seems like it could get messy fast.

Or say we do something simple like just rename an assembly or a namespace. I&#039;m pretty sure that would break the binary serializer and I wouldn&#039;t want to have to keep that old assembly lying around indefinitely just to support those legacy events in the event store.

In this case, wouldn&#039;t it be ok to modify the event store and migrate the old events to the new events - as long as the semantic meaning of the events is still the same?

And if so, is there an easy way to go about performing such a migration assuming the events are binary serialized somewhere?</description>
		<content:encoded><![CDATA[<p>I can see how a method like this would work well for simple changes like the one you described. But how would you handle big changes?</p>
<p>For instance, say that we do a big refactor and we rename/move/merge/split some of our events. Having to keep those &#8220;old&#8221; events around along with the newly refactored events seems like it could get messy fast.</p>
<p>Or say we do something simple like just rename an assembly or a namespace. I&#8217;m pretty sure that would break the binary serializer and I wouldn&#8217;t want to have to keep that old assembly lying around indefinitely just to support those legacy events in the event store.</p>
<p>In this case, wouldn&#8217;t it be ok to modify the event store and migrate the old events to the new events &#8211; as long as the semantic meaning of the events is still the same?</p>
<p>And if so, is there an easy way to go about performing such a migration assuming the events are binary serialized somewhere?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/02/09/cqrs-event-versioning/comment-page-1/#comment-53547</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Thu, 11 Feb 2010 20:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/02/09/cqrs-event-versioning/#comment-53547</guid>
		<description>Mark,
according to the conversation with @seagile, you want to keep all the events versions in your code, am I getting it right? Wouldn&#039;t xml serialized versions of them be enough for the mentioned audit log?
The second think is a case, when the newly added property, for instance AtmId cannot be null nor empty. What about this case? Or maybe new properties should always allow default(T) values to be set? One of the aspects of event sourcing is the ability to undo and redo the events execution. What if the undo moves the history to the point when an event has a nulls_not_allowed property set to null? Is this kind of situation possible at all?

Who&#039;s the nagger? :-P</description>
		<content:encoded><![CDATA[<p>Mark,<br />
according to the conversation with @seagile, you want to keep all the events versions in your code, am I getting it right? Wouldn&#8217;t xml serialized versions of them be enough for the mentioned audit log?<br />
The second think is a case, when the newly added property, for instance AtmId cannot be null nor empty. What about this case? Or maybe new properties should always allow default(T) values to be set? One of the aspects of event sourcing is the ability to undo and redo the events execution. What if the undo moves the history to the point when an event has a nulls_not_allowed property set to null? Is this kind of situation possible at all?</p>
<p>Who&#8217;s the nagger? <img src='http://elegantcode.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

