Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Short Answer</strong></p> <ol> <li>I haven't seen lots of partitions cause Azure Tables (AZT) problems, but I don't have this volume of data.</li> <li>The more items in a partition, the slower queries in that partition</li> <li>Sorry no, I don't have the benchmarks</li> <li>See below</li> </ol> <p><strong>Long Answer</strong></p> <p>In your case I suspect that SQL Azure is not going work for you, simply because of the limits on the size of a SQL Azure database. If each of those rows you're inserting are 1K with indexes you will hit the 50GB limit in about 300 days. It's true that Microsoft are talking about databases bigger than 50GB, but they've given no time frames on that. SQL Azure also has a throughput limit that I'm unable to find at this point (I pretty sure it's less than what you need though). You might be able to get around this by partitioning your data across more than one SQL Azure database.</p> <p>The advantage SQL Azure does have though is the ability to run aggregate queries. In AZT you can't even write a <code>select count(*) from customer</code> without loading each customer.</p> <p>AZT also has a limit of 500 transactions per second per partition, and a limit of <a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/05/10/windows-azure-storage-abstractions-and-their-scalability-targets.aspx" rel="noreferrer">"several thousand" per second per account</a>.</p> <p>I've found that choosing what to use for your partition key (PK) and row key depends (RK) on how you're going to query the data. If you want to access each of these items individually, simply give each row it's own partition key and a constant row key. This will mean that you have lots of partition.</p> <p>For the sake of example, if these rows you were inserting were orders and the orders belong to a customer. If it was more common for you to list orders by customer you would have PK = CustomerId, RK = OrderId. This would mean to find orders for a customer you simply have to query on the partition key. To get a specific order you'd need to know the CustomerId and the OrderId. The more orders a customer had, the slower finding any particular order would be.</p> <p>If you just needed to access orders just by OrderId, then you would use PK = OrderId, RK = string.Empty and put the CustomerId in another property. While you can still write a query that brings back all orders for a customer, because AZT doesn't support indexes other than on PartitionKey and RowKey if your query doesn't use a PartitionKey (and sometimes even if it does depending on how you write them) will cause a table scan. With the number of records you're talking about that would be very bad.</p> <p>In all of the scenarios I've encountered, having lots of partitions doesn't seem to worry AZT too much.</p> <p>Another way you can partition your data in AZT that is not often mentioned is to put the data in different tables. For example, you might want to create one table for each day. If you want to run a query for last week, run the same query against the 7 different tables. If you're prepared to do a bit of work on the client end you can even run them in parallel.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload