Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Azure Blob Storage what is the difference between Virtual Directory and Containers?

I want to build scalable storage but I am confused as to when you would use Virtual Directory as opposed to Containers. Which is more performant when uploading images using C# .NET Core, or if they both have their own use cases, what would they be?

I was expecting that a container would be used as below:

  • PhoneImages (Container)
    • iPhone11 (Virtual Directory) then inside that virtual directory
      • iPhone11 Side Image
      • iPhone11 Rear Image

However, it occurred to me that you could use a container for each phone model as below:

  • iPhone14Images
  • SamsungS21Images
  • GooglePixel7Images
like image 327
Anonymous Avatar asked Jan 27 '26 08:01

Anonymous


1 Answers

A virtual directory is essentially just a group of blobs with the same naming prefix. A container is more like a physical folder. You could potentially use them interchangeably but there are differences.

One key difference for your use case may be that a container name can only be 63 characters long and only contain certain characters. A blob name - including the prefix - can be up to 1024 characters and use any combination of characters. Another thing to note is that a container can be empty whereas a virtual directory can't be as it is a collection of blobs. If there are no blobs with the virtual directory prefix it effectively doesn't exist.

References:

  • https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction
  • https://learn.microsoft.com/en-us/rest/api/storageservices/Naming-and-Referencing-Containers--Blobs--and-Metadata
like image 87
SBFrancies Avatar answered Jan 28 '26 21:01

SBFrancies



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!