Using Blob or FileStream or File Service to store our asp.net core web application's files RRS feed

  • Question

  • I am build a new asp.net core MVC web application, the web application is a workflow based system which will be accessed by different users, as follow:-

    1. the workflow will have 10++ steps.

    2. Inside each step there will be a tab to upload and store files (images, pds, office, etc..).

    3. The system will prevent duplicate files names to be uploaded inside the same step, but will allow this to be done on separate tabs.

    4. Users can add a description for each of the uploaded file + define if the file can be viewed by all users or only by selected users (define a privacy setting for each file).

    Now i am not sure which appraoch i should follow to store the files:-

    1. Blob

    2. FileStream

    3. or store them on the windows drive (file system)

    now i read many articles about this, and generally people suggest to store the files outside the database, as database is designed to store structured data, and also to prevent increasing the database size. so maybe i can exclude using the Blob ,, but bot sure what will be the pros and cons of using FileStream compared to storing the files directly to the File system?

    Note, now we are planning to host the web application to a cloud provider (Azure for example), so we will chose to use the latest version of sql server.

    • Edited by johnjohn11 Friday, May 17, 2019 1:46 AM
    Friday, May 17, 2019 1:44 AM


  • Hi johnjohn11,

    FILESTREAM integrates the SQL Server Database Engine with an NTFS or ReFS file systems by storing varbinary(max) binary large object (BLOB) data as files on the file system. FILESTREAM is used to store the data in your file system. Please refer to FILESTREAM (SQL Server).

    If you want to store small objects directly in the database, you can use standard varbinary(max) columns in your table. If your unstructured data, such as documents and images, are larger than 1 MB, it is recommended to use FILESTREAM. Please refer to When to Use FILESTREAM.

    Best Regards,
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Saturday, May 18, 2019 5:07 AM