<?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: Clarified CQRS</title>
	<atom:link href="http://www.udidahan.com/2009/12/09/clarified-cqrs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/</link>
	<description>Enterprise Development Expert &#38; SOA Specialist</description>
	<lastBuildDate>Fri, 23 Jul 2010 18:21:18 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt S.</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37313</link>
		<dc:creator>Matt S.</dc:creator>
		<pubDate>Wed, 30 Jun 2010 21:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37313</guid>
		<description>That makes sense; a cookie or lightweight session data. Thanks, Udi.</description>
		<content:encoded><![CDATA[<p>That makes sense; a cookie or lightweight session data. Thanks, Udi.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37312</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Wed, 30 Jun 2010 13:25:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37312</guid>
		<description>Matt,

If this is a web system, put that information from the command in the cookie and then overlay it on the data retrieved from the query side. You can do similar things in smart clients.

In that way, it won&#039;t show the old address when the user looks at it, irrespective of the fact that the query side is delayed.</description>
		<content:encoded><![CDATA[<p>Matt,</p>
<p>If this is a web system, put that information from the command in the cookie and then overlay it on the data retrieved from the query side. You can do similar things in smart clients.</p>
<p>In that way, it won&#8217;t show the old address when the user looks at it, irrespective of the fact that the query side is delayed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt S.</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37306</link>
		<dc:creator>Matt S.</dc:creator>
		<pubDate>Tue, 29 Jun 2010 18:22:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37306</guid>
		<description>The thing I still struggle most with with CQRS is how to handle a &quot;mixed system&quot;. For example, suppose some views are collaborated on by multiple actors, but other views are the responsibility of a single user.

Udi, you commented above that if your wife and you both change your account address, it&#039;s okay for the system to apply both commands. I get that, but how do ensure that the data is not stale if you forgot to change something on your account moments later? If your change address command is not issued synchronously (or at least nearly immediately), you&#039;ll see the old address (from cache) on your edit account view. Being a user, you&#039;ll scowl and mumble something to the effect of, &quot;I just changed my address! Why is it still showing my old address?&quot;

What do we do in the cases of our users self-editing information in the system that they expect to see freshly updated?</description>
		<content:encoded><![CDATA[<p>The thing I still struggle most with with CQRS is how to handle a &#8220;mixed system&#8221;. For example, suppose some views are collaborated on by multiple actors, but other views are the responsibility of a single user.</p>
<p>Udi, you commented above that if your wife and you both change your account address, it&#8217;s okay for the system to apply both commands. I get that, but how do ensure that the data is not stale if you forgot to change something on your account moments later? If your change address command is not issued synchronously (or at least nearly immediately), you&#8217;ll see the old address (from cache) on your edit account view. Being a user, you&#8217;ll scowl and mumble something to the effect of, &#8220;I just changed my address! Why is it still showing my old address?&#8221;</p>
<p>What do we do in the cases of our users self-editing information in the system that they expect to see freshly updated?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tarek</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37240</link>
		<dc:creator>Tarek</dc:creator>
		<pubDate>Sun, 09 May 2010 08:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37240</guid>
		<description>I think I have sort of the same question that Mark Philips raised and I feel like the answer is not that clear yet (at least for me). I believe it goes down to the concept of a bounded context. It&#039;s not so easy to partition your domain into clear cuts and one of the areas which will always be shared is reference data.

I&#039;ll try to provide a simple example: Suppose I have two ACs; one handling customer registration and another handling order submission. They both depend on one piece of information; whether the user&#039;s country is part of the EU. In the registration case, we&#039;d like to give the user a discount if he&#039;s in the EU and in the orders case, the shipping costs will depend on that piece of information.

Definitely, the information about a country being in the EU is not contained within the registration or orders contexts. So the question is: Should those ACs request such information from another AC?

In essence, should ACs direct their data queries to other ACs?

Thanks</description>
		<content:encoded><![CDATA[<p>I think I have sort of the same question that Mark Philips raised and I feel like the answer is not that clear yet (at least for me). I believe it goes down to the concept of a bounded context. It&#8217;s not so easy to partition your domain into clear cuts and one of the areas which will always be shared is reference data.</p>
<p>I&#8217;ll try to provide a simple example: Suppose I have two ACs; one handling customer registration and another handling order submission. They both depend on one piece of information; whether the user&#8217;s country is part of the EU. In the registration case, we&#8217;d like to give the user a discount if he&#8217;s in the EU and in the orders case, the shipping costs will depend on that piece of information.</p>
<p>Definitely, the information about a country being in the EU is not contained within the registration or orders contexts. So the question is: Should those ACs request such information from another AC?</p>
<p>In essence, should ACs direct their data queries to other ACs?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CQRS isn&#8217;t the answer &#8211; it&#8217;s just one of the questions</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37230</link>
		<dc:creator>CQRS isn&#8217;t the answer &#8211; it&#8217;s just one of the questions</dc:creator>
		<pubDate>Fri, 07 May 2010 09:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37230</guid>
		<description>[...] the growing interest in Command/Query Responsibility Segregation (CQRS), more people are starting to ask questions about how to apply it to their applications. CQRS is [...]</description>
		<content:encoded><![CDATA[<p>[...] the growing interest in Command/Query Responsibility Segregation (CQRS), more people are starting to ask questions about how to apply it to their applications. CQRS is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37199</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Fri, 23 Apr 2010 16:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37199</guid>
		<description>Hendry,

I&#039;ve answered some of these questions as presented on the DDD discussion group. 

On the issue of collections, line items in an order need not be accessible outside of the order. We can handle the customer&#039;s total order value with a property on the customer entity that is updated on each order. This structure would more closely reflect the language of the domain too.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Hendry,</p>
<p>I&#8217;ve answered some of these questions as presented on the DDD discussion group. </p>
<p>On the issue of collections, line items in an order need not be accessible outside of the order. We can handle the customer&#8217;s total order value with a property on the customer entity that is updated on each order. This structure would more closely reflect the language of the domain too.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hendry Luk</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37185</link>
		<dc:creator>Hendry Luk</dc:creator>
		<pubDate>Tue, 20 Apr 2010 09:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37185</guid>
		<description>Great article Udi. This is definitely one of the most comprehensive articles ever written in CQRS topic.
There are however some bits where I feel like you make a big deduction leap that I can&#039;t quite follow.

[&quot;And if we’ve already got a notification model set up, do we really need to return an error to the customer service rep? I mean, it’s not like they can do anything about it other than notifying the customer.&quot;]
IMO you&#039;re making too many &quot;if&quot; assumptions in that deduction. Let&#039;s branch the hypothetical a bit and take another real-world case where an attempt to place an order is invalidated because the combination of the selected handset/service/contract-type is not available. The sales rep will *need* to be notified &quot;synchronously&quot; about this, so he can try again with a different combination that are valid according to the business-rule (by talking it through with the customer of course). Order-submission is a command, and it *is* expected to give an immediate feedback to the sales rep upon its failure/success.
Another highly common example is to perform credit-check via an external institution before allowing the sales-rep to progress further into product selection screen, or perhaps limitting the product selection to certain amount of value, based on the customer&#039;s credit-rating calculated by the legal institution. A request to perform a credit-check via a legal institution is a command, and again, an immediate feedback to sales-rep is expected.

[&quot;Do we really need a collection of orders on the customer entity? In what command would we need to navigate that collection?&quot;]
In the commands where we might perform business-rule to apply certain logic if customer&#039;s total orders have exceeded certain value. Probably doesnt make sense in this case since customer and order are probably 2 different aggregate roots. But more sensible in the case of order and order-items (e.g. &quot;checking that all order-items within the order are within certain threshold&quot;. Or, &quot;if all the order-items within a single order are delivered to a maximum of 3 different addresses&quot;).</description>
		<content:encoded><![CDATA[<p>Great article Udi. This is definitely one of the most comprehensive articles ever written in CQRS topic.<br />
There are however some bits where I feel like you make a big deduction leap that I can&#8217;t quite follow.</p>
<p>["And if we’ve already got a notification model set up, do we really need to return an error to the customer service rep? I mean, it’s not like they can do anything about it other than notifying the customer."]<br />
IMO you&#8217;re making too many &#8220;if&#8221; assumptions in that deduction. Let&#8217;s branch the hypothetical a bit and take another real-world case where an attempt to place an order is invalidated because the combination of the selected handset/service/contract-type is not available. The sales rep will *need* to be notified &#8220;synchronously&#8221; about this, so he can try again with a different combination that are valid according to the business-rule (by talking it through with the customer of course). Order-submission is a command, and it *is* expected to give an immediate feedback to the sales rep upon its failure/success.<br />
Another highly common example is to perform credit-check via an external institution before allowing the sales-rep to progress further into product selection screen, or perhaps limitting the product selection to certain amount of value, based on the customer&#8217;s credit-rating calculated by the legal institution. A request to perform a credit-check via a legal institution is a command, and again, an immediate feedback to sales-rep is expected.</p>
<p>["Do we really need a collection of orders on the customer entity? In what command would we need to navigate that collection?"]<br />
In the commands where we might perform business-rule to apply certain logic if customer&#8217;s total orders have exceeded certain value. Probably doesnt make sense in this case since customer and order are probably 2 different aggregate roots. But more sensible in the case of order and order-items (e.g. &#8220;checking that all order-items within the order are within certain threshold&#8221;. Or, &#8220;if all the order-items within a single order are delivered to a maximum of 3 different addresses&#8221;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olav Rask</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37183</link>
		<dc:creator>Olav Rask</dc:creator>
		<pubDate>Mon, 19 Apr 2010 16:00:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37183</guid>
		<description>Hi

If anybody (Udi? :) ) is stil following comments here, can someone elaborate a bit on how to keep the read site up to date?

Say I assign a user a new role, resulting in a UserAssignedNewRole event containing the UserId and RoleId. When i go to update my &quot;UsersWithRoleName&quot; read-side table, am i suppose to have the roles stored seperately on the read side, in order to find the role name, to put in?

This could potentialy mean storing the entire model as well as the denormalized tables on the read side.. ..would you recommend this or do you have an alternate approache?

Kind regards
Olav</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>If anybody (Udi? <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) is stil following comments here, can someone elaborate a bit on how to keep the read site up to date?</p>
<p>Say I assign a user a new role, resulting in a UserAssignedNewRole event containing the UserId and RoleId. When i go to update my &#8220;UsersWithRoleName&#8221; read-side table, am i suppose to have the roles stored seperately on the read side, in order to find the role name, to put in?</p>
<p>This could potentialy mean storing the entire model as well as the denormalized tables on the read side.. ..would you recommend this or do you have an alternate approache?</p>
<p>Kind regards<br />
Olav</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37163</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sun, 11 Apr 2010 16:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37163</guid>
		<description>ToddM,

Glad you liked it.

You don&#039;t necessarily need to include the cache-updating AC if you implement your query store as views on top of your domain store. Keep in mind that this doesn&#039;t mean you can skip thinking about the level of staleness that the business is willing to live with.

All in all, sounds good.</description>
		<content:encoded><![CDATA[<p>ToddM,</p>
<p>Glad you liked it.</p>
<p>You don&#8217;t necessarily need to include the cache-updating AC if you implement your query store as views on top of your domain store. Keep in mind that this doesn&#8217;t mean you can skip thinking about the level of staleness that the business is willing to live with.</p>
<p>All in all, sounds good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tacidic</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37161</link>
		<dc:creator>Tacidic</dc:creator>
		<pubDate>Sun, 11 Apr 2010 06:20:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37161</guid>
		<description>Great article Udi.  Quick question for you: if you&#039;re updating the OLAP db whenever a change occurs (i.e., all the time) and you&#039;re querying the same db (all the time) aren&#039;t you just shifting the bottleneck?</description>
		<content:encoded><![CDATA[<p>Great article Udi.  Quick question for you: if you&#8217;re updating the OLAP db whenever a change occurs (i.e., all the time) and you&#8217;re querying the same db (all the time) aren&#8217;t you just shifting the bottleneck?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ToddM</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37160</link>
		<dc:creator>ToddM</dc:creator>
		<pubDate>Sat, 10 Apr 2010 20:22:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37160</guid>
		<description>Excellent article. I always found it unrealistic to always use the domain model for views when it&#039;s so much more efficient to go directly to the database and query for exactly what you need. But it&#039;s always felt dirty to pollute my domain objects with view-specific queries. Here finally is a pattern that acknowledges the problem and deals with it elegantly. Very enlightening.

I&#039;m considering simplifying one aspect of this pattern in my initial implementation. I&#039;m using SQL Server for my main data store. Rather than creating a separate physical query store, I&#039;m going to create a set of view-specific indexed views and stored procedures in the same database. I&#039;ll use a separate SQL Server schema (named QueryStore, or something like that) and a separate connection string in my config files. This way I don&#039;t need worry about synchronizing the query store - it&#039;s done automatically. View indexes and object-level locking should help with performance, but if the day comes that I need to scale my query store out to its own database/server, I should be able to do so without major re-architecture of other components of the system.</description>
		<content:encoded><![CDATA[<p>Excellent article. I always found it unrealistic to always use the domain model for views when it&#8217;s so much more efficient to go directly to the database and query for exactly what you need. But it&#8217;s always felt dirty to pollute my domain objects with view-specific queries. Here finally is a pattern that acknowledges the problem and deals with it elegantly. Very enlightening.</p>
<p>I&#8217;m considering simplifying one aspect of this pattern in my initial implementation. I&#8217;m using SQL Server for my main data store. Rather than creating a separate physical query store, I&#8217;m going to create a set of view-specific indexed views and stored procedures in the same database. I&#8217;ll use a separate SQL Server schema (named QueryStore, or something like that) and a separate connection string in my config files. This way I don&#8217;t need worry about synchronizing the query store &#8211; it&#8217;s done automatically. View indexes and object-level locking should help with performance, but if the day comes that I need to scale my query store out to its own database/server, I should be able to do so without major re-architecture of other components of the system.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: What is the Ncqrs Framework?</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37157</link>
		<dc:creator>What is the Ncqrs Framework?</dc:creator>
		<pubDate>Thu, 08 Apr 2010 19:05:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37157</guid>
		<description>[...] Clarified CQRS by Udi Dahan [...]</description>
		<content:encoded><![CDATA[<p>[...] Clarified CQRS by Udi Dahan [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CodEagle &#187; CQRS &#38;&#38; Validation &#38;&#38; Business Rules</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37074</link>
		<dc:creator>CodEagle &#187; CQRS &#38;&#38; Validation &#38;&#38; Business Rules</dc:creator>
		<pubDate>Thu, 04 Mar 2010 20:16:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37074</guid>
		<description>[...] for itself yet. Proposal: &#8220;Circular Architecture&#8221;? [3] This is explained nicely in this post by Udi Dahan. Search for &#8220;Commands and validation&#8221;. [4] An explanation can be found in a fine post [...]</description>
		<content:encoded><![CDATA[<p>[...] for itself yet. Proposal: &#8220;Circular Architecture&#8221;? [3] This is explained nicely in this post by Udi Dahan. Search for &#8220;Commands and validation&#8221;. [4] An explanation can be found in a fine post [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37059</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sun, 28 Feb 2010 14:26:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37059</guid>
		<description>Leonardo,

If the data is needed by the client as soon as it is submitted, it is there - on the client that submitted it. No need to poll the query side. The only thing that might not have been there is an ID from the database - which is easily solved with client-generated GUIDs instead of database-generated IDs.</description>
		<content:encoded><![CDATA[<p>Leonardo,</p>
<p>If the data is needed by the client as soon as it is submitted, it is there &#8211; on the client that submitted it. No need to poll the query side. The only thing that might not have been there is an ID from the database &#8211; which is easily solved with client-generated GUIDs instead of database-generated IDs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonardo</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37046</link>
		<dc:creator>Leonardo</dc:creator>
		<pubDate>Tue, 23 Feb 2010 20:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37046</guid>
		<description>Yeah, but if the data is needed as soon as it is submitted, I may call the query before the event was handled, so I would not retrieve the changes, but the same state as before. In this case, I only think about polling. Maybe the query could return together with the results the date and time it was last updated, so when that changes, i stop polling.

What would you do in that case?</description>
		<content:encoded><![CDATA[<p>Yeah, but if the data is needed as soon as it is submitted, I may call the query before the event was handled, so I would not retrieve the changes, but the same state as before. In this case, I only think about polling. Maybe the query could return together with the results the date and time it was last updated, so when that changes, i stop polling.</p>
<p>What would you do in that case?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37044</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Tue, 23 Feb 2010 16:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37044</guid>
		<description>Leonardo,

I don&#039;t think Comet is needed for that - some simple browser side javascript (aka AJAX) can take the data that was submitted in the command and append it to the results from the query side. As this is browser side, it brings no scalability overhead. Hope that answers your question.</description>
		<content:encoded><![CDATA[<p>Leonardo,</p>
<p>I don&#8217;t think Comet is needed for that &#8211; some simple browser side javascript (aka AJAX) can take the data that was submitted in the command and append it to the results from the query side. As this is browser side, it brings no scalability overhead. Hope that answers your question.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leonardo</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37042</link>
		<dc:creator>Leonardo</dc:creator>
		<pubDate>Tue, 23 Feb 2010 01:48:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37042</guid>
		<description>Udi,

How would you see integrating this with Comet, in order to make the result from the repo db appear in the same page where the command was requested? Does this scale? Is there any disadvantage of using this approach?</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>How would you see integrating this with Comet, in order to make the result from the repo db appear in the same page where the command was requested? Does this scale? Is there any disadvantage of using this approach?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37019</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Fri, 05 Feb 2010 18:54:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37019</guid>
		<description>Andyb,

If we don&#039;t have any other means to communicate with the user, like another email address (Yahoo does this), let&#039;s say we did nothing. This is a rare occurrence - a race condition between two users for the same email.

What is likely to happen is that the user will try to login at some time in the future, won&#039;t succeed, and will re-register (or give up).

In the case they give up, saving this one user in a million probably isn&#039;t worth the cost of doing so. Even though I&#039;m guessing that that&#039;s an answer you don&#039;t want to hear :)</description>
		<content:encoded><![CDATA[<p>Andyb,</p>
<p>If we don&#8217;t have any other means to communicate with the user, like another email address (Yahoo does this), let&#8217;s say we did nothing. This is a rare occurrence &#8211; a race condition between two users for the same email.</p>
<p>What is likely to happen is that the user will try to login at some time in the future, won&#8217;t succeed, and will re-register (or give up).</p>
<p>In the case they give up, saving this one user in a million probably isn&#8217;t worth the cost of doing so. Even though I&#8217;m guessing that that&#8217;s an answer you don&#8217;t want to hear <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andyb</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37018</link>
		<dc:creator>andyb</dc:creator>
		<pubDate>Fri, 05 Feb 2010 14:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37018</guid>
		<description>yeah, that&#039;s the obvious part, but what to do in catch to notify the user?

you suggest before to only rely on exceptions in exceptional situations (like db not available), but is this the case here? as i said an unique const violation is normal behaviour (like email adr must be unique), isn&#039;t it?</description>
		<content:encoded><![CDATA[<p>yeah, that&#8217;s the obvious part, but what to do in catch to notify the user?</p>
<p>you suggest before to only rely on exceptions in exceptional situations (like db not available), but is this the case here? as i said an unique const violation is normal behaviour (like email adr must be unique), isn&#8217;t it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37017</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Fri, 05 Feb 2010 12:28:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37017</guid>
		<description>Andyb,

Then we would have a try catch for that specific type of exception in that handler :)</description>
		<content:encoded><![CDATA[<p>Andyb,</p>
<p>Then we would have a try catch for that specific type of exception in that handler <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andyb</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37016</link>
		<dc:creator>andyb</dc:creator>
		<pubDate>Thu, 04 Feb 2010 16:20:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37016</guid>
		<description>Udi,

you suggest to let a db constraint check uniqueness as in comment #46. in case of a violation the db provider throws an exception. Typically exceptions causes msgs to get poisoned, which causes retries, which maybe succeed if the value becomes availible but ultimatly the msg will go to an error queue. but in case of a unique constaint violation there is hardly anything an admin can do with the msg in the error queue, rather its a &quot;normal event&quot;. also some component has to catch that and notify the user somehow.

my question is: how do you handle that?</description>
		<content:encoded><![CDATA[<p>Udi,</p>
<p>you suggest to let a db constraint check uniqueness as in comment #46. in case of a violation the db provider throws an exception. Typically exceptions causes msgs to get poisoned, which causes retries, which maybe succeed if the value becomes availible but ultimatly the msg will go to an error queue. but in case of a unique constaint violation there is hardly anything an admin can do with the msg in the error queue, rather its a &#8220;normal event&#8221;. also some component has to catch that and notify the user somehow.</p>
<p>my question is: how do you handle that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37011</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Tue, 02 Feb 2010 15:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37011</guid>
		<description>Andrew,

Our goal is to identify along with our business stakeholders which user intent is significant. If your business logic has &#039;if&#039; statements to do something about a given scenario, it is likely that we need to introduce a command for that. Typing more commands is the least of our worries.</description>
		<content:encoded><![CDATA[<p>Andrew,</p>
<p>Our goal is to identify along with our business stakeholders which user intent is significant. If your business logic has &#8216;if&#8217; statements to do something about a given scenario, it is likely that we need to introduce a command for that. Typing more commands is the least of our worries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37010</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Tue, 02 Feb 2010 15:07:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37010</guid>
		<description>Jon,

It is likely the batch processing that you&#039;re describing isn&#039;t a command in its own right, rather it is a batch of commands, where each can succeed or fail independent of the others.

On the other hand, this can be an ETL-style thing, in which case the previous statement may not hold.

I&#039;d deal with the above questions before looking at efficiency. If the former is the case, you can parallelize the execution of commands, even if it appears inefficient at first blush.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Jon,</p>
<p>It is likely the batch processing that you&#8217;re describing isn&#8217;t a command in its own right, rather it is a batch of commands, where each can succeed or fail independent of the others.</p>
<p>On the other hand, this can be an ETL-style thing, in which case the previous statement may not hold.</p>
<p>I&#8217;d deal with the above questions before looking at efficiency. If the former is the case, you can parallelize the execution of commands, even if it appears inefficient at first blush.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Deakins</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-37009</link>
		<dc:creator>Andrew Deakins</dc:creator>
		<pubDate>Tue, 02 Feb 2010 14:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-37009</guid>
		<description>Hi Udi,

Great to read and finally understand the essence of CQRS.  My only fear is that how do you deal with command explosion? for instance there maybe a hundred different reasons why somebody would change their name and having a command indicating the intent of each and every one seems a little silly.

I guess with most things a little common sense applies here correct?</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>Great to read and finally understand the essence of CQRS.  My only fear is that how do you deal with command explosion? for instance there maybe a hundred different reasons why somebody would change their name and having a command indicating the intent of each and every one seems a little silly.</p>
<p>I guess with most things a little common sense applies here correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Living in the Tech Avalanche Generation &#187; Finding my way with MongoDB and C# &#8211; Part 1.0</title>
		<link>http://www.udidahan.com/2009/12/09/clarified-cqrs/comment-page-2/#comment-36997</link>
		<dc:creator>Living in the Tech Avalanche Generation &#187; Finding my way with MongoDB and C# &#8211; Part 1.0</dc:creator>
		<pubDate>Mon, 25 Jan 2010 13:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.udidahan.com/?p=1149#comment-36997</guid>
		<description>[...] on the query side in a CQRS architecture for instance, serving as a store for directly bound view model data. MongoDB at first glance offers some nice features that would blend well into an architecture [...]</description>
		<content:encoded><![CDATA[<p>[...] on the query side in a CQRS architecture for instance, serving as a store for directly bound view model data. MongoDB at first glance offers some nice features that would blend well into an architecture [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
