Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Table Storage - Entity Design Best Practices Question

Im writing a 'proof of concept' application to investigate the possibility of moving a bespoke ASP.NET ecommerce system over to Windows Azure during a necessary re-write of the entire application.

Im tempted to look at using Azure Table Storage as an alternative to SQL Azure as the entities being stored are likely to change their schema (properties) over time as the application matures further, and I wont need to make endless database schema changes. In addition we can build refferential integrity into the applicaiton code - so the case for considering Azure Table Storage is a strong one.

The only potential issue I can see at this time is that we do a small amount of simple reporting - i.e. value of sales between two dates, number of items sold for a particular product etc. I know that Table Storage doesnt support aggregate type functions, and I believe we can achieve what we want with clever use of partitions, multiple entity types to store subsets of the same data and possibly pre-aggregation but Im not 100% sure about how to go about it.

Does anyone know of any in-depth documents about Azure Table Storage design principles so that we make proper and efficient use of Tables, PartitionKeys and entity design etc.

there's a few simplistic documents around, and the current books available tend not to go into this subject in much depth.

FYI - the ecommerce site has about 25,000 customers and takes about 100,000 orders per year.

like image 799
Dean Chalk Avatar asked Apr 14 '11 11:04

Dean Chalk


People also ask

What is the maximum size of an entity in Azure Table storage?

An entity in Azure Storage can be up to 1MB in size. An entity in Azure Cosmos DB can be up to 2MB in size. Properties: A property is a name-value pair. Each entity can include up to 252 properties to store data.

Can two entities in same table storage contains different collection of properties?

An entity has a primary key and a set of properties. A property is a name, typed-value pair, similar to a column. The Table service does not enforce any schema for tables, so two entities in the same table may have different sets of properties.

How many properties you can have per entity in Azure tables?

An entity can have up to 255 properties, including 3 system properties described in the following section. Therefore, the user may include up to 252 custom properties, in addition to the 3 system properties. The combined size of all data in an entity's properties cannot exceed 1 MiB.


2 Answers

Have you seen this post ? http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx

Pretty thorough coverage of tables

like image 73
yacine Avatar answered Oct 10 '22 18:10

yacine


I think there are three potential issues I think in porting your app to Table Storage.

  1. The lack of reporting - including aggregate functions - which you've already identified
  2. The limited availability of transaction support - with 100,000 orders per year I think you'll end up missing this support.
  3. Some problems with costs - $1 per million operations is only a small cost, but you can need to factor this in if you get a lot of page views.

Honestly, I think a hybrid approach - perhaps EF or NH to SQL Azure for critical data, with large objects stored in Table/Blob?

Enough of my opinion! For "in depth":

  • try the storage team's blog http://blogs.msdn.com/b/windowsazurestorage/ - I've found this very good
  • try the PDC sessions from Jai Haridas (couldn't spot a link - but I'm sure its there still)
  • try articles inside Eric's book - http://geekswithblogs.net/iupdateable/archive/2010/06/23/free-96-page-book---windows-azure-platform-articles-from.aspx
  • there's some very good best practice based advice on - http://azurescope.cloudapp.net/ - but this is somewhat performance orientated
like image 25
Stuart Avatar answered Oct 10 '22 19:10

Stuart