locked
Should I use Blobs, DocumentDB or something else RRS feed

  • Question

  • I am developing an asp-MVC solution that requires the ability to store documents (pdfs, word, images etc.) for each record in a table. The details view will allow the user to upload, remove and list any documents that have already been uploaded.

    My thought is to create a new blob container whenever a new record is created which will hold the documents that have been uploaded but I am not sure if this is the best option. From a scalability perspective I would hope eventually to have over 10,000 records however it may take a while to get up that number.

    I have come across DocumentsDB but I am very new to this and not sure this is what it's been designed for.

    Is Blobs the right solution for this?

    Also, I have been working on other aspects of the project so I have created an ASP.NET project in which I would like to use the storage. Looking at some tutorials they all talk about creating a Cloud Service Project. Does this mean I have to add another project to the solution or can you add this to the existing asp.net project?

    Thursday, October 2, 2014 1:17 AM

Answers

  • My recommendation would be to go with blob storage and along with that use either table storage or SQL Database. The reason for using Blob Storage is that it is meant for this purpose only and you get massive storage (500 TB / storage account). I would not recommend using DocumentDB for a few reasons:

    • Though DocumentDB supports storing blobs as attachments, the amount of data that you can store today in DocumentDB is limited. I'm sure this is a limitation because it is currently in preview but still the limitation exists.
    • As of today, you can't directly stream the content stored as DocumentDB attachment. What you would need to do is first reach the content in your application and then stream it from there. Blob storage does not have this limitation.
    • DocumentDB would turn out to be much more expensive than going with Azure Storage.

    The challenge with Blob Storage is that it does not have querying capabilities so you can't just find out the list of blobs uploaded by a user unless you partition the data appropriately (e.g. creating a separate blob container / user). Even then you can't find out how many blobs are uploaded by a user say in a date range. That's why I recommended using either table storage or SQL database to keep a list of all files uploaded by a user as both of them will provide you with nice querying capabilities. If you want, you can use DocumentDB for that purpose as well. The advantage that I see using DocumentDB for storing this kind of data over Table Storage is that everything is indexed by default (thus you can query on any field) and you write queries using familiar SQL syntax. But cost is an important consideration there.

    Hope this answers your question.

    Thursday, October 2, 2014 6:59 AM