<?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: How we got rid of the database&#8211;part 3</title>
	<atom:link href="http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/</link>
	<description>Blog about architectural patterns, best practices, coding principles and techniques</description>
	<lastBuildDate>Wed, 22 May 2013 12:15:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Steve Friend</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-484</link>
		<dc:creator>Steve Friend</dc:creator>
		<pubDate>Wed, 20 Jun 2012 10:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-484</guid>
		<description> &quot;every job I&#039;ve had data has needed to be updated almost in real-time; if
 Joe Customer places an order in our store, we need an agent to follow 
up with it relatively fast, if not immediately. &quot;
Really? How do you cope with peak hours, do you increase the number of agents you have so they can respond immediately?  Do your customers place order by &#039;phone?

I work for a large-ish online retailer (think ~$500m sales/year) and we don&#039;t need to respond to orders immediately.</description>
		<content:encoded><![CDATA[<p> &#8221;every job I&#8217;ve had data has needed to be updated almost in real-time; if<br />
 Joe Customer places an order in our store, we need an agent to follow<br />
up with it relatively fast, if not immediately. &#8221;<br />
Really? How do you cope with peak hours, do you increase the number of agents you have so they can respond immediately?  Do your customers place order by &#8216;phone?</p>
<p>I work for a large-ish online retailer (think ~$500m sales/year) and we don&#8217;t need to respond to orders immediately.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-483</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Wed, 20 Jun 2012 02:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-483</guid>
		<description>One thing to keep in mind is that the user typically doesn&#039;t think of screens as reports. Putting a date on the screen doesn&#039;t disabuse them of the desire to treat data as data, if that&#039;s what they really want.

Eventual consistency is a recent invention. Before computers, eventual consistency was across departmental boundaries, but not internally. In good task based UIs, users reason about tasks and think about success/fail in terms of requests, not reports.</description>
		<content:encoded><![CDATA[<p>One thing to keep in mind is that the user typically doesn&#8217;t think of screens as reports. Putting a date on the screen doesn&#8217;t disabuse them of the desire to treat data as data, if that&#8217;s what they really want.</p>
<p>Eventual consistency is a recent invention. Before computers, eventual consistency was across departmental boundaries, but not internally. In good task based UIs, users reason about tasks and think about success/fail in terms of requests, not reports.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: darylmer</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-482</link>
		<dc:creator>darylmer</dc:creator>
		<pubDate>Tue, 19 Jun 2012 21:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-482</guid>
		<description>Just want to put in a little note here about some of the questions that people have and mention that the Lokad CQRS sample project has been updated and is slightly different in a few areas.  As for the views, the way I usually describe the eventual consistency scenario is to think about those views almost like a report.  When you run a report is it only current at the instant it completes.  By the time you see it on screen or printed it should be considered old and that is why most people put the date and time a report was run on it.  People generally accept that a report is outdated basically the instant it completes.  

The views are updated pretty darn quick.  The only scenario where they wouldn&#039;t be is if there was a fairly significant number of commands that got dropped in just before your command.  I have been working on a project to convert data from an old system to a new system via issuing the old data as new commands and this is where things can get bogged down.  I am looking at finding a better way to deal with views used as indexes because an add to the index requires a full read/full write of the entire view as an atomic operation which bogs as there are more items added to the view.  I have thousands of commands issued in a a very short time(this is not a normal situation and is only for conversion) and you really see the impact when it has to open the index view update the data and then write it all back for each add/update.  This is an optimization situation where you have to get creative. Under normal circumstances this isn&#039;t and won&#039;t be an issue for me, however, if you plan on running under pretty heavy load you will have to find a better way to deal with this which may mean keeping a lightweight traditional database only for the indexed views.</description>
		<content:encoded><![CDATA[<p>Just want to put in a little note here about some of the questions that people have and mention that the Lokad CQRS sample project has been updated and is slightly different in a few areas.  As for the views, the way I usually describe the eventual consistency scenario is to think about those views almost like a report.  When you run a report is it only current at the instant it completes.  By the time you see it on screen or printed it should be considered old and that is why most people put the date and time a report was run on it.  People generally accept that a report is outdated basically the instant it completes.  </p>
<p>The views are updated pretty darn quick.  The only scenario where they wouldn&#8217;t be is if there was a fairly significant number of commands that got dropped in just before your command.  I have been working on a project to convert data from an old system to a new system via issuing the old data as new commands and this is where things can get bogged down.  I am looking at finding a better way to deal with views used as indexes because an add to the index requires a full read/full write of the entire view as an atomic operation which bogs as there are more items added to the view.  I have thousands of commands issued in a a very short time(this is not a normal situation and is only for conversion) and you really see the impact when it has to open the index view update the data and then write it all back for each add/update.  This is an optimization situation where you have to get creative. Under normal circumstances this isn&#8217;t and won&#8217;t be an issue for me, however, if you plan on running under pretty heavy load you will have to find a better way to deal with this which may mean keeping a lightweight traditional database only for the indexed views.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-481</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 19 Jun 2012 18:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-481</guid>
		<description> Thank you John, you hit the nail! I wouldn&#039;t have been able to explain it any better :)</description>
		<content:encoded><![CDATA[<p> Thank you John, you hit the nail! I wouldn&#8217;t have been able to explain it any better <img src='http://lostechies.com/gabrielschenker/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Teague</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-480</link>
		<dc:creator>John Teague</dc:creator>
		<pubDate>Tue, 19 Jun 2012 17:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-480</guid>
		<description>This really depends on implementation and what you mean by immediate feedback.  One  way to give immediate feedback even if the command and event process takes a while is to update the UI as if the command will succeed.  A core tenant to CQRS is to make commands as small as possible with high probability of success.  If the command passes validation, the chances of failure should be very small.  So you can update the user&#039;s view with the result as if it did succeed and in the case of failure, take a &quot;compensating action.&quot;  Like alerting the user if they are still online or sending an email message if they are not.  

A common example of this is credit card validation.  While the number is validated in real time, more verifications must take place and are done after the order is places, like credit limit checks.  If there is a problem you get an email letting you know your order was not placed and why.</description>
		<content:encoded><![CDATA[<p>This really depends on implementation and what you mean by immediate feedback.  One  way to give immediate feedback even if the command and event process takes a while is to update the UI as if the command will succeed.  A core tenant to CQRS is to make commands as small as possible with high probability of success.  If the command passes validation, the chances of failure should be very small.  So you can update the user&#8217;s view with the result as if it did succeed and in the case of failure, take a &#8220;compensating action.&#8221;  Like alerting the user if they are still online or sending an email message if they are not.  </p>
<p>A common example of this is credit card validation.  While the number is validated in real time, more verifications must take place and are done after the order is places, like credit limit checks.  If there is a problem you get an email letting you know your order was not placed and why.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Teague</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-479</link>
		<dc:creator>John Teague</dc:creator>
		<pubDate>Tue, 19 Jun 2012 17:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-479</guid>
		<description>I hear this all the time too when I talk about CQRS.  There&#039;s a couple of things I always talk about when I&#039;m asked.  The first thing I say is that updates in real time are myth, at least it&#039;s so difficult to really do it usually not worth it.  

The example I give is a user is looking at an update screen, with the &quot;current&quot; data populated so they can change it.  The user then takes a 20 minute phone call and then comes back makes the change.  Did you check before making that update there were no changes while they were on the phone?  It&#039;s not guaranteed to be  consistent.  We&#039;ve sold to the users this myth that that they have consistent data when it&#039; really not,unless you go through great pains to ensure that&#039;s the case.

So assuming you aren&#039;t guaranteeing perfect consistency, with an eventual consistency approach, you now must ask the business what level of consistency they need (explaining at 0ms consistency is not possible).  You&#039;ll be surprised at the answers you get, 5 minuts, 20 minutes, 1 hour.  I&#039;ve got applications that update data from different systems once a day, as requested from the business owners. It will be rare that they give an answer that is under 1 second.  If it is, then your job is describe the time and resources required to meet that SLA. 

Once you know what your consistency contraints are, you can now give solutions to the problem based on an actual business requirement. 

In your comment you said &quot;almost real time&quot;  is that real time from the users perspective or from the machine perpective?  Is 5 seconds &quot;almost&quot;  or is 5 milliseconds.  You can send a message to the other side of world in 5 seconds,  5 milliseconds is a different story.  The point is, until you ask you don&#039;t know.</description>
		<content:encoded><![CDATA[<p>I hear this all the time too when I talk about CQRS.  There&#8217;s a couple of things I always talk about when I&#8217;m asked.  The first thing I say is that updates in real time are myth, at least it&#8217;s so difficult to really do it usually not worth it.  </p>
<p>The example I give is a user is looking at an update screen, with the &#8220;current&#8221; data populated so they can change it.  The user then takes a 20 minute phone call and then comes back makes the change.  Did you check before making that update there were no changes while they were on the phone?  It&#8217;s not guaranteed to be  consistent.  We&#8217;ve sold to the users this myth that that they have consistent data when it&#8217; really not,unless you go through great pains to ensure that&#8217;s the case.</p>
<p>So assuming you aren&#8217;t guaranteeing perfect consistency, with an eventual consistency approach, you now must ask the business what level of consistency they need (explaining at 0ms consistency is not possible).  You&#8217;ll be surprised at the answers you get, 5 minuts, 20 minutes, 1 hour.  I&#8217;ve got applications that update data from different systems once a day, as requested from the business owners. It will be rare that they give an answer that is under 1 second.  If it is, then your job is describe the time and resources required to meet that SLA. </p>
<p>Once you know what your consistency contraints are, you can now give solutions to the problem based on an actual business requirement. </p>
<p>In your comment you said &#8220;almost real time&#8221;  is that real time from the users perspective or from the machine perpective?  Is 5 seconds &#8220;almost&#8221;  or is 5 milliseconds.  You can send a message to the other side of world in 5 seconds,  5 milliseconds is a different story.  The point is, until you ask you don&#8217;t know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Monsters X</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-478</link>
		<dc:creator>Monsters X</dc:creator>
		<pubDate>Tue, 19 Jun 2012 14:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-478</guid>
		<description>Why not use couchdb or something, same storage (JSON objects) but all sorts of easy fanciness (like clusters, atomic transactions, etc..)</description>
		<content:encoded><![CDATA[<p>Why not use couchdb or something, same storage (JSON objects) but all sorts of easy fanciness (like clusters, atomic transactions, etc..)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-477</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 19 Jun 2012 13:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-477</guid>
		<description>That is a concern most newcomers have. I did too! But in reality it turns out not to be a problem; why? I&#039;ll dedicate a upcoming post to that topic - eventual consistency. Stay tuned.</description>
		<content:encoded><![CDATA[<p>That is a concern most newcomers have. I did too! But in reality it turns out not to be a problem; why? I&#8217;ll dedicate a upcoming post to that topic &#8211; eventual consistency. Stay tuned.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wayne M</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-476</link>
		<dc:creator>Wayne M</dc:creator>
		<pubDate>Tue, 19 Jun 2012 12:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-476</guid>
		<description>I&#039;m just a little bit confused by this although it seems interesting.  How do you &quot;sync&quot; the data between the read model and the write model?  In a real-world scenario users are constantly updating the data (or customers are placing orders, whatever) and this usually has to be reflected fairly quickly in a back-end system with the &quot;read model&quot;.  If you&#039;re using let&#039;s say Sql Server for the write model and RavenDB for the read model, how is the data meant to be synced without impacting performance or making users wait a day to get the current day&#039;s orders, etc.

I guess the main confusion point for this whole CQRS type of architecture is that I don&#039;t quite get how it applies to real scenarios; every job I&#039;ve had data has needed to be updated almost in real-time; if Joe Customer places an order in our store, we need an agent to follow up with it relatively fast, if not immediately.   Is this type of architecture just not suited to the majority of transactional use cases or am I missing something crucial?</description>
		<content:encoded><![CDATA[<p>I&#8217;m just a little bit confused by this although it seems interesting.  How do you &#8220;sync&#8221; the data between the read model and the write model?  In a real-world scenario users are constantly updating the data (or customers are placing orders, whatever) and this usually has to be reflected fairly quickly in a back-end system with the &#8220;read model&#8221;.  If you&#8217;re using let&#8217;s say Sql Server for the write model and RavenDB for the read model, how is the data meant to be synced without impacting performance or making users wait a day to get the current day&#8217;s orders, etc.</p>
<p>I guess the main confusion point for this whole CQRS type of architecture is that I don&#8217;t quite get how it applies to real scenarios; every job I&#8217;ve had data has needed to be updated almost in real-time; if Joe Customer places an order in our store, we need an agent to follow up with it relatively fast, if not immediately.   Is this type of architecture just not suited to the majority of transactional use cases or am I missing something crucial?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oded</title>
		<link>http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-475</link>
		<dc:creator>Oded</dc:creator>
		<pubDate>Tue, 19 Jun 2012 08:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/gabrielschenker/2012/06/18/how-we-got-rid-of-the-databasepart-3/#comment-475</guid>
		<description>@cbp - Eventual Consistency. There is no guarantee for seeing _immediate_ results.</description>
		<content:encoded><![CDATA[<p>@cbp &#8211; Eventual Consistency. There is no guarantee for seeing _immediate_ results.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
