Optimizing Azure Blob Storage Uploads

During this week I have been working on an application that relies on Azure Blob Storage. In a few words the application run some processes and uploads the resulting files to Azure. The after each run, some files can change while other remains equal. In order to optimize the application JuanAr suggested adding logic to the application in order to upload only the changed files.

So I invested some time to implement what we called the SmartUploader.  This class is very simple, it acts as a wrapper around the Azure Storage Client API. Each time this class uploads a file it calculates a checksum value and stores it in the blob metadata. So the next time before uploading the file it compares the current checksum of the file to upload with the checksum of the previously uploaded file and if it is the same the it avoids the upload because it means that the file has not changed.

The code snippet below shows the interesting part of the SmartUploader.

And here is the method that calculates the checksum.

Hope this helps you.


Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.