tomalex
tomalex

Reputation: 1271

Using Azure blob Container in right way?

I'm currently exploring Azure Blob Storage in my nodejs application and would like to know how to take advantage of Container in azure blob

In current app setup i have sub sections like

Each of them have feature to upload files, which is eventually going to azure blob

Should i create container for each section, will there be any advantage? What is the preferred approach?

https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/

Container: A container provides a grouping of a set of blobs. All blobs must be in a container. An account can contain an unlimited number of containers. A container can store an unlimited number of blobs. Note that the container name must be lowercase.

Upvotes: 2

Views: 1163

Answers (2)

Gunjan Jain - MSFT
Gunjan Jain - MSFT

Reputation: 51

Main advantages of separating multiple containers is that containers provide nice logical grouping of blobs and security access boundaries. Since partitioning in Azure Blobs is at the blob level, so you should not see much difference in terms of scalability and parallelism of accessing blobs under containers. Please see this thread with a similar discussion. Is it better to have many small Azure storage blob containers (each with some blobs) or one really large container with tons of blobs?

Upvotes: 3

This is really dependent on your application design; there is no "right way". From what you have posted above, it looks like it might make sense to create containers for profile and communities.

You could then create virtual directories for the subsections under communities. A virtual directory is really part of a blob name, but you can use it to traverse your blobs hierarchically, the way you would a file system.

See Azure Blob Storage Samples for Node.js for examples that show how to list blobs.


Here's some additional information about virtual directories, from the Azure Storage documentation:

Blob names may simulate a directory structure by including a delimiter character, such as a forward slash (/). A virtual directory is an abstraction provided by the client library to simplify navigating that directory structure. Containers and blobs are Azure resources, with their own endpoints, but a virtual directory is part of a blob name.

For example, suppose you have a blob whose absolute URI is:

https://storagesample.blob.core.windows.net/sample-container/level1/level2/level3/blob.txt

The blob name is:

level1/level2/level3/blob.txt

The virtual directories that are part of the blob name are:

  • level1/level2/level3/

  • level1/level2/

  • level1/

Upvotes: 5

Related Questions