multumedia items in DB or not?

  • Hello,

    We plan a web application where a user can add multiple photos, sound, pdf and even some videos.

    We don't know for now if the best place to store those multimedia items. In the DB or in a file system on the server.

    Can you give your opinion on this?

    Thank you

    Martin

  • You need to start with your design requirements. It is not possible to say that storing multimedia in SQL Server is always a good idea or always a bad idea.

    If you are looking just at SQL Server performance, storing object under 250KB within SQL Server out-performs all other types of storage, but if object size is 1MB or greater then alternative storage formats are generally faster. (Google 'to blob or not to blob' for details.)

    However, performance is not your only criteria. If you have 5 million objects stored in the file system that must be replicated across sites with active-active access on both sites, this can be hard to achieve. If you store 5 million objects within SQL Server then replication is easier to deal with, but if the objects are large you may have issues around optimising disk space use within SQL Server.

    Your requirements will play a big part in deciding what design options can be used.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Do you have the option of SQL Server 2008? SQL Server 2008 introduces the Filestream data type which is designed for applications such as yours.

    If you cannot use 2008 I would recommend storing the multimedia files in the file system. As Ed has already said, you really need to look at your requirements before making the final decision.

  • Another contributing factor will be if the web server is on a different physical computer from the database server. If they are, you probably don't want all of that extra data traveling an extra hop over the network. We tend to store the image, multimedia, etc. in folders on the web server, and just store the path\filename in the actual database.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply