<?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>Azure Support &#187; Tables</title>
	<atom:link href="http://www.azuresupport.com/tag/tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.azuresupport.com</link>
	<description>Windows Azure Tutorial</description>
	<lastBuildDate>Mon, 25 Apr 2011 10:32:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Azure&#8217;s Killer Feature &#8211; Table Storage [Blog]</title>
		<link>http://www.azuresupport.com/2009/12/azures-killer-feature-tables-blog/</link>
		<comments>http://www.azuresupport.com/2009/12/azures-killer-feature-tables-blog/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 11:51:26 +0000</pubDate>
		<dc:creator>azuresupport</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Tables]]></category>

		<guid isPermaLink="false">http://www.azuresupport.com/?p=206</guid>
		<description><![CDATA[Azure is stuffed with great features promising effortless scale and instant failover and disaster protection, but for me it&#8217;s Table Storage which are Azure&#8217;s  killer feature. SQL Server and SQL Azure are great products but for a lot (maybe even the vast majority) of cases they are overkill and add an unnecessary overhead and slow [...]]]></description>
			<content:encoded><![CDATA[<p>Azure is stuffed with great features promising effortless scale and instant failover and disaster protection, but for me it&#8217;s <strong>Table Storage </strong>which are Azure&#8217;s  killer feature.</p>
<p>SQL Server and SQL Azure are great products but for a lot (maybe even the vast majority) of cases they are overkill and add an unnecessary overhead and slow development. But there are almost no alternatives to persist structured data in a .NET application. XML is a good choice for small data storage tasks or for transmitting data, but it does not scale well. So for almost any structured data developers are forced to create and maintain databases, put query logic in the database and open and close database connections to read/write the data.</p>
<p>I recently heard Matt Mullenweg founder of WordPress.com discussing how WordPress uses MySQL simply as a dumb data store, no stored procedures, triggers etc. WordPress runs pretty much all the largest blogs and scales very well.</p>
<p>Clearly then, there&#8217;s a need for something a lot simpler than a full database &#8211; enter Tables, Azure&#8217;s answer to Amazon&#8217;s SimpleDB. In Tables data is stored in rows and columns but less structure is imposed than in database tables. Rules of normalization are relaxed and mixing different forms of data in a single table is now efficient. Tables don&#8217;t require connections like databases and more importantly they are blazingly fast and quick to develop.</p>
<p>Table storage goes some way to alleviate the biggest pain point for Azure adoption by smaller web developers &#8211; the minimum $10 per database which quickly racks up the monthly cost when several sites are added. Tables might prove a viable database alternative.</p>
<p>It will be very interesting to see how Tables evolve and which applications move over from  SQL Server and SQL Azure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azuresupport.com/2009/12/azures-killer-feature-tables-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Azure &#8211; Table Storage Introduction</title>
		<link>http://www.azuresupport.com/2009/12/windows-azure-storage-tables/</link>
		<comments>http://www.azuresupport.com/2009/12/windows-azure-storage-tables/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 08:46:21 +0000</pubDate>
		<dc:creator>azuresupport</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Tables]]></category>

		<guid isPermaLink="false">http://www.azuresupport.com/?p=137</guid>
		<description><![CDATA[In addition to SQL Azure, Windows Azure features four persistent storage forms Tables, Queues , Blobs , and Drives. In this article we will focus on Tables. Table Storage Tables are a very interesting new storage method offered in Windows Azure and are Microsoft&#8217;s Azure answer to Amazon SimpleDB..  The SQL Azure database offers a [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to SQL Azure, Windows Azure features four persistent storage forms Tables,  Queues , Blobs<br />
 , and Drives. In this article we will focus on Tables.</p>
<h2>Table Storage</h2>
<p>Tables are a very interesting new storage method offered in Windows Azure and are Microsoft&#8217;s Azure answer to Amazon SimpleDB..  The SQL Azure database offers a wealth of features a modern database might be expected to provide. However for many purposes it is overkill. In the past almost any structured data had to go into the database and incur the performance penalty that entailed. With Azure Tables data which has a relatively simple structure (below we use the example of a Movies data, which is a listing of Movies with different attributes such as title, category, date etc but is not a very complex dataset).</p>
<p>Tables offer structured data storage for data that has relatively simple relationships. Data is stored in rows and as tables are less structured and don&#8217;t have the overhead of a full database it is massively scalable and offers very high performance.  The interface to Azure Tables is the familiar .NET suite of classes, LINQ, and REST.</p>
<p>To create an Azure Table first create a storage service in the Windows Azure Developer Portal, then create a storage account and from create tables. Each table is scoped to its storage account so different tables with the same name can be used but scoped to different storage accounts.</p>
<h3>Table Data Model</h3>
<p>Tables are composed of rows and columns. For the purposes of the Azure Table Data Model, rows are <em>entities</em> and columns are <em>properties</em>. For an Entity a set of Properties can be defined but several properties are mandatory &#8211; PartitionKey, RowKey and TimeStamp. PartitionKey and RowKey can be thought of as a clustered index which uniquely identifies an entity and defines the sort order. TimeStamp is a read-only property.</p>
<h3>Partitions</h3>
<p>Table partitions can be thought of as units of scale within Windows Azure which are used for load balancing. Tables are partitioned based on the PartitionKey, all entities on the same PartitionKey will be served by a single server. Therefore selection of an appropriate PartitionKey is central to achieving scalability and higher throughput on Windows Azure. It is important to note that Azure implements throttling of an account when the resource utilization is very high, appropriate partitioning greatly reduces the potential for this happening by allowing the load to be distributed over different servers. The RowKey provides uniqueness within a single partition.<br />
 Partitions can be thought of as a higher level categories for the data with RowKeys are lower level data details. For example, for a &#8216;Movies&#8217; table the PartitionKey could be the category of the movie such as comedy or sci-fi, RowKey could be the movie title (hopefully the combination of category and title would ensure uniqueness). Under load the table cold be split onto different servers  based on the category.<br />
 For a write intensive scenario such as logging the PartitionKey would normally be a timestamp. In this instance there is a problem in partitioning as the write will also append to the bottom of the Table and partitioning based on a range will not be efficient as the final partition will always be the only active partition. The recommended solution to this is to add a prefix to the timestamp to ensure that the latest write operations are sent to different partitions.</p>
<p>In database design, tables should be split based on the data type. For example in an retailer&#8217; s database, data of the type &#8216;customer&#8217; with fields such as &#8216;name&#8217;, &#8216;address&#8217; etc should be in a separate table to the &#8216;orders&#8217; which only contains data on orders such as &#8216;product&#8217;,  &#8216;order_date&#8217; etc. However in Azure Tables these could both be efficiently stored in the same table as no space would be taken up by the empty fields (such as &#8216;order_date&#8217; for a &#8216;customer&#8217;). To differentiate between the two types of data a &#8216;Kind&#8217; property (column) can be added to each entity (row) which is in effect the table name if they were separated into two tables.</p>
<h3>Table Operations</h3>
<p>The operations are relatively similar to those of a conventional database &#8211; tables (which are analogous to the database) can be created, queried and deleted. Entities (rows) can have insert operations performed, delete operations, queries, and updated. There are two methods of update &#8211; Merge and Replace. Merge allows a partial update of the entity, thus if some of the properties of the entity are not given with the update they would not be updated (only the properties provided in the update are updated). Replace updates all the properties of an entity, if a property is not provided in the update it is removed from the entity. A newly introduced feature is Entity Group Transaction which is a transaction over a single partition.</p>
<h3>Continuation Tokens</h3>
<p>When a single entity(row is queried) the result is returned as with a database query. However when a range is requested Azure Tables can only return 1000 rows in a result set. If the result set is less than 1000 rows that result set is returned, if the result set is larger than 999 , the first 1000 rows of the result set are return together with a <strong>Continuation Token</strong>.  The Table is then re-queried with the Continuation Token passed back to the Table until the query completes.<br />
 Continuation Tokens are returned for all results where the   results is greater than one. They will also be returned if a query takes longer than 5 seconds (this is the maximum allowed by Azure after which the results are returned with a continuation token and the query must be rerun). Furthermore, continuation tokens are returned when the end of a partition range boundary is hit.</p>
<p><br class="spacer_" /></p>
<h3>Optimizing Queries</h3>
<p>Querying a table with a range is a very serial process, with result sets being sent to the client and continuation tokens being sent back for processing until the query completes. This structure doe not allow for any parallel processing. To take advantage of parallel processing the query should be split into ranges based on the PartitionKey, for example instead of</p>
<p>[cc lang='sql' ]Select * from Movies where Rating &gt; 4[/cc]</p>
<p>Use</p>
<p>[cc lang='sql' ]</p>
<p>Select * from Movies where PartitionKey  &gt;= &#8216;A&#8217; and PartitionKey &lt; &#8216;D&#8217; and Rating &gt; 4<br />
 Select * from Movies where PartitionKey  &gt;= &#8216;D&#8217; and PartitionKey &lt; &#8216;G&#8217; and Rating &gt; 4</p>
<p>[/cc]</p>
<p>This enables the query to run in a parallel manner.</p>
<p>Similar to SQL Server, views can also be created to handle popular queries.</p>
<p>Be careful using &#8216;OR&#8217; in queries. SQL Azure Tables do not do any optimization on these queries. It is optimal to split the query into several separate queries.</p>
<h3>Entity Group Transactions</h3>
<p>EGT&#8217;s offer transaction-like operations on an Azure table. Up to 100 insert/update/delete commands can be performed in a single transaction provided the payload is under 4MB.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azuresupport.com/2009/12/windows-azure-storage-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

