I have a mass upload system that I would like to do the following:
But the order of the blocks returned from the API is not the order that the documentation says it will be.
According to the Azure storage API site,
The list of uncommitted blocks is returned beginning with the most recently uploaded block to the oldest uploaded block. (https://msdn.microsoft.com/en-us/library/azure/dd179400.aspx , under the Remarks section at the bottom)
However, raw API calls and also the Microsoft Azure Storage SDK are both returning the blocks in alphabetical order, not in the order they were uploaded in any way.
Am I reading the documentation wrong? Could this be a bug in the API? The local storage emulator is also giving the same results.
Thanks!
We checked things out storage service-side and here's the deal: The docs have a bug. Since day 1 the list of uncommitted blocks has been returned in alphabetical order. We will be updating the MSDN docs as soon as possible to remove the error and we're sorry for any inconvenience!
Here's some ideas for solving your problem:
Explore some other blob types.
An append blob might be better overall if you want to write data in the order it was uploaded. Append blobs have the same read behavior and throughput as block blobs, but don't allow you to update or delete blocks which have been already been put. But, to append data all you need to do is an appendBlock and that will add to the end of the blob -- no commit needed!
Page blobs will also allow you to put data without a commit. Unlike append blobs, they will allow modifications in the middle of the blob. However, they have strict limitations on data length being divisible by 512. So, if that wasn't a natural property of your data you'd need to deal with padding.
The SDKs have great chunking support for append and page where you can just throw in the data and it will get put. With block of course there's chunking too but state is maintained client side.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With