About Azure Table Storage Row 1MB Limit, How it counts for UTF8 Code?

Eric Yin picture Eric Yin · Jan 21, 2012 · Viewed 13.6k times · Source

Lets first quote:

Combined size of all of the properties in an entity cannot exceed 1MB. (for a ROW/Entity) from msdn

My Questions is: Since everything is XMLed data, so for 1MB, is 1MB of what, 1MB of ASCII Chars, or 1MB of UTF8 Chars, or something else?

Sample:

Row1: PartitionKey="A', RowKey="A", Data="A"
Row2: PartitionKey="A', RowKey="A", Data="A"  (this is a UTF8 unicode A)

Is Row1 and Row2 same size (in length), or Row2.Length=Row1.Length+1?

Answer

RyanFishman picture RyanFishman · Jan 23, 2012

Single columns such as "Data" in your example are limited to 64 KB of binary data and single rows are limited to 1 MB of data. Strings are encoding into binary in the UTF8 format so the limit is whatever the byte size ends up being for your string. If you want your column to store more than 64 KB of data you can use a technique such as FAT Entity which is provided to you with Lokad (https://github.com/Lokad/lokad-cloud-storage/blob/master/Source/Lokad.Cloud.Storage/Azure/FatEntity.cs). The technique is pretty simple, you just encode your string to binary and then split the binary across multiple columns. Then when you want to read the string from the table, you would just re-join the columns again and convert the binary back to a string.