开发者

Azure Table Complex Data Best Practices

开发者_开发百科I'm working on a research project that needs to store complex data as entities in an Azure Table. The entities for the table are cells that contains many geometric points and lines, with references to parents and so on.

Unless I am mistaken, an entity can only contain simple types (string, int, bool, etc) but nothing like List. I'm working around this in the meantime by just serializing the entire structure and converting that to a base64 string and having the entity consist of just this string, as well as some other flags.

Now that is a ludicrous approach in the long run, but that hack will have to do for now until a more responsible/appropriate method is deployed.

What would the best practices be for complex data types and Azure? Write many blobs out and keep track of them with a table?


I don't think Azure storage differs much from regular data storage in this case. Complex data types always either have their properties mapped to simple data columns, or you serialize (as you said).


I think there's a lot to think about when using Azure for this type of storage - especially thinking about:

  • indexing - Azure only allows you to index and order only on the tuple (account, table name, partition key, row key) - so if you need to search or order your data in multiple ways then generally you need to think about adding multiple entities to multiple tables to represent your single actual entity
  • aggregation - Azure table storage doesn't contain any SQL-like SUM, AVERAGE, etc functions - so if you need to do any of these then you'll need to do them in your own code and to persist the result somewhere (or generate them on the fly each time - but this could be slow and costly for large data sets)
  • performance - depending on your application, there may be lots to consider here.
  • cost - remember that Azure storage charges per transaction - so if you do a lot of queries then it can cost you money (also remember that while Azure storage is scalable, the per second query limits per account aren't that high)

There are lots of articles and documents out there on patterns and practices for using Azure table and blob storage - for your situation, using Blobs with one or more table based indicies certainly sounds like one avenue to explore.


The lokad toolkit is your best friend for azure.

You're looking for a "Fat Entity" http://code.google.com/p/lokad-cloud/wiki/FatEntities

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜