Anonymous
Anonymous

Reputation: 81

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:

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

Upvotes: 3

Views: 1706

Answers (1)

SBFrancies
SBFrancies

Reputation: 4250

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:

Upvotes: 2

Related Questions