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.

Deja una respuesta

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. Salir /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Salir /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Salir /  Cambiar )

Conectando a %s

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.