Share via

Store and Read video and audio and images

Arshad Nazeer 21 Reputation points
2022-11-12T10:53:58.017+00:00

Hi.
I want to store video and audio in SQL database and Source Tree.
I want to play video and audio after fetching it from Database and Source Tree in a browser.
I want to store images in SQL Database and Source Tree.
I want to display images after fetching it from SQL Database and Source Tree in a browser.

How to do it?

Is it a good practice to store video, audio, and images in database?

Thanks in advance.

Developer technologies | ASP.NET Core | Other

1 answer

Sort by: Most helpful
  1. TengFeiXie-MSFT 351 Reputation points
    2022-11-14T09:41:47.973+00:00

    Hi, @Arshad Nazeer

    Based on the information you provided. I don't think it's a good way to store large files into SQL database.

    1. Storing large files such as video and audio in the database will take up a lot of space and cause the database to expand. Also makes reading and querying files in the database slower.
    2. It will make your database backups slower and take up more bandwidth. Fetching data from the database will take more time.

    As already mentioned by community member( @AgaveJoe ), I also recommend that you use file system to store these source files. Store the file name and storage path in SQL database. File system is already optimized for storing, retrieving, and indexing files. You just need to look up the filename and storage path into the database. Obtain the file path by querying the database through the browser.

    Best regards,
    TengFei Xie


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.