<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>t h e D a v i d A i k e n &#187; nosql</title>
	<atom:link href="http://www.davidaiken.com/tag/nosql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidaiken.com</link>
	<description>Not Statistically Significant</description>
	<lastBuildDate>Wed, 16 Nov 2011 04:04:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>De-Normalizing your data</title>
		<link>http://www.davidaiken.com/2010/04/13/de-normalizing-your-data/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.davidaiken.com/2010/04/13/de-normalizing-your-data/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 15:00:00 +0000</pubDate>
		<dc:creator>theDavidAiken</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Bid Now Sample]]></category>
		<category><![CDATA[Cloud Patterns]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[Table Storage]]></category>

		<guid isPermaLink="false">http://www.davidaiken.com/2010/04/13/de-normalizing-your-data/</guid>
		<description><![CDATA[I mentioned yesterday about how we use some trickery to maintain the top views table in Bid Now.
Items are stored in a table, but to generate a quick top views view, we maintain a separate table. This is done using the Task/Queue/Task pattern described yesterday here.
Since TOP isn’t a keyword that  [...]]]></description>
			<content:encoded><![CDATA[<p>I mentioned yesterday about how we use some trickery to maintain the top views table in <a href="http://code.msdn.microsoft.com/BidNowSample">Bid Now</a>.</p>
<p>Items are stored in a table, but to generate a quick top views view, we maintain a separate table. This is done using the Task/Queue/Task pattern described yesterday <a href="http://www.davidaiken.com/2010/04/12/web-queue-task-queue-task/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">here</a>.</p>
<p>Since TOP isn’t a keyword that Windows Azure table storage deals with, we have to use some trickery.</p>
<p>Items are stored in the AuctionItems table. But when you visit the home page, you get several different lists of items. Each of these items are in fact separate tables, which are kept up to date using the Task/Queue/Task pattern.</p>
<p><a href="http://www.davidaiken.com/wp-content/uploads/2010/04/image2.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.davidaiken.com/wp-content/uploads/2010/04/image_thumb.png" width="644" height="335" /></a> </p>
<p>For the Most Viewed list – we use the MostViewedItems table. The table contains PartitionKey, RowKey, TimeStamp, Title, EndDate, ItemId, PhotoUrl, ShortDescription &amp; ThumbnailUrl. In fact just enough information to display the list and enable a click through to the item details.</p>
<p>The query to return the top 5 items is simple – we simply return the first 5 items from that table – which is super fast. How you say. Well we use the PartitonKey to order the table!</p>
<p>Take a look at the Most Viewed from the home page.</p>
<p><a href="http://www.davidaiken.com/wp-content/uploads/2010/04/image3.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.davidaiken.com/wp-content/uploads/2010/04/image_thumb1.png" width="231" height="418" /></a> </p>
<p>Here is the MostViewItems table. Note the partition key is numerical. Every time an item is viewed we read the row, decrement the number in the partition key, save the new row and delete the old one. (since you cannot update the partition key).</p>
<p><a href="http://www.davidaiken.com/wp-content/uploads/2010/04/image4.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.davidaiken.com/wp-content/uploads/2010/04/image_thumb2.png" width="644" height="162" /></a> </p>
<p>Note Football is 2nd from the bottom. If we view football, the update works and we end up with this on the home page.</p>
<p><a href="http://www.davidaiken.com/wp-content/uploads/2010/04/image5.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.davidaiken.com/wp-content/uploads/2010/04/image_thumb3.png" width="238" height="422" /></a> </p>
<p>And an update to the partition key. Note the number has been decremented by one.</p>
<p><a href="http://www.davidaiken.com/wp-content/uploads/2010/04/image6.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.davidaiken.com/wp-content/uploads/2010/04/image_thumb4.png" width="644" height="158" /></a> </p>
</p>
</p>
<p>You can use this pattern to keep your own data de-normalized and provide super fast queries.</p>
<p>THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS<a href="http://www.davidaiken.com/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidaiken.com/2010/04/13/de-normalizing-your-data/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New Bid Now Sample on Code Gallery</title>
		<link>http://www.davidaiken.com/2010/04/08/new-bid-now-sample-on-code-gallery/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.davidaiken.com/2010/04/08/new-bid-now-sample-on-code-gallery/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 00:27:50 +0000</pubDate>
		<dc:creator>theDavidAiken</dc:creator>
				<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Bid Now Sample]]></category>
		<category><![CDATA[nosql]]></category>

		<guid isPermaLink="false">http://www.davidaiken.com/2010/04/08/new-bid-now-sample-on-code-gallery/</guid>
		<description><![CDATA[I’ve just posted the latest version of Bid Now on code gallery at http://code.msdn.microsoft.com/BidNowSample! On code gallery you will find the code, as well as some guidance on how to get Bid Now running on your machine, as well as how you can deploy it to the cloud.
A few days back I presented  [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve just posted the latest version of Bid Now on code gallery at <a title="http://code.msdn.microsoft.com/BidNowSample" href="http://code.msdn.microsoft.com/BidNowSample">http://code.msdn.microsoft.com/BidNowSample</a>! On code gallery you will find the code, as well as some guidance on how to get Bid Now running on your machine, as well as how you can deploy it to the cloud.</p>
<p>A few days back I presented at the <a href="http://www.msdnevents.com/firestarter/">Windows Azure fire starter</a> event here in Redmond. (More on that in a few days when the videos are posted.) This is one of the demos I showed during my talk.</p>
<p>The demo is built on Windows Azure, and uses Windows Azure table and blob storage for data. There are some great things to look at in the code, such as the decoupling of functionality and use of Windows Azure Queues. It is also a great example of how you can build complex data applications using Windows Azure table storage. Think nosql here.</p>
<p>If you look at the homepage you can see there are several “views” of the data. As an example the <em>boots</em> below are shown in both the “Bids ending soon!” and “Hottest” sections. This data is pulled from different Windows Azure tables as all the data has been de-normalized.</p>
<p><img style="display: inline; border: 0px;" title="image" src="http://www.davidaiken.com/wp-content/uploads/2010/04/image.png" border="0" alt="image" width="642" height="362" /></p>
<p>Over the next few days I’ll be posting more details on how we built this app, some of the do’s and don’ts as well as how you can use it for your own demos/projects.</p>
<p>THIS POSTING IS PROVIDED “AS IS” WITH NO WARRANTIES, AND CONFERS NO RIGHTS</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidaiken.com/2010/04/08/new-bid-now-sample-on-code-gallery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

