Keeping a top 20 in azure table storage

Azure Table Storage is a cheap, fast and easy to use data storage system.

It does have it’s limitations.

All data has two keys partition key and row key which need to be unique in combination.

The best way to guarantee the return of say the latest 20 entries is to use  DateTime.MaxTicks – DateTime.Now.Utc (in a 19 digit left padded with zeros format) as the row key.

This means that reading the data you can just fetch the items by partition key with a limit on how many rows to return.

The difficulty will come in keeping the data from filling up the storage account if you never clean up.

I would suggest that when the data is read back if you get the maximum number of items that you queried then perform a second query to return 100 rows older than the oldest row that you have just fetched and delete them in a single async batch. This is the optimum delete size (as 100 is the max batch size for azure table storage).

Groovy and Powershell

I have started looking at the language Groovy.

Groovy starts with java as a base language. It is backwards compatible to Java and compiles to the same jvm instructions.

It takes some different design decisions to it’s parent language. Everything is public by default, supports operator overloading, and has thrown away much of Java’s verbosity.

Oddly enough it looks like a parallel between Powershell and C#.

Now Powershell is not a compiled language, but can run C# inline.

Groovy’s scripting shell is very restricted as to be for simple experimentation only.

Both languages have identical tricks when it comes to closures, parameter, and advanced string handling GStrings in groovy have an almost identical syntax to the Powershell equivalent.

This also means that both languages are good at hosting DSL’s since they both support the fundamental pieces needed to do this (minimal ceremony syntax and closures).

Latest Azure Guest OS

Family IsDefault Version
3 False WA-GUEST-OS-3.21_201411-01
3 False WA-GUEST-OS-3.22_201412-01
3 True WA-GUEST-OS-3.23_201501-01
4 False WA-GUEST-OS-4.14_201411-01
4 False WA-GUEST-OS-4.15_201412-01
4 True WA-GUEST-OS-4.16_201501-01

Here is the latest guest os details.