Saving videos to sql or file

Hi everyone,

I'm creating a website in asp.net, the main point will be to upload/download and watch video's/pictures and voice notes. I was going to go about on saving them to sql, but when I started researching I found that it is not a good idea to use sql for videos? Majority that I found said that it is more suitable with saving them to a file, but the problem is that there can be thousands of video's, so I was wondering if anybody can please explain the difference of sql and file saving to me? Any reading material will be much appreciated as well! And if so any suggestions on how to do it as I have never worked with videos before so no idea how to begin saving and on...

Thanks so m

May 14th, 2013 9:30am

Firstly, you can save video objects in varbinary data file. I don't remember the complete syntax of C# but you have to convert your video file in byte array. 

Now, frankly speaking it would be very slow because SQL Server and your code has to do extra overhead to convert your video to byte and vice versa. And think about server memory too. And that's why people recommend to use file system. It works faster than data system. Alternatively, you can use Microsoft media services to host your videos. This will ensure that data is transferred quickly and will cost you less [when compared to your local bandwidth].

Again, if you want to use SQL Server then I will recommend you to use File table feature of SQL Server 2012. It is meant to store large objects and works faster than varbinary. It also provide you flexibility to query your directory or files.

However, if you are stick to SQL Server storage in byte format then I will recommend you to search online for tutorial like this.

Hope this will help.

Free Windows Admin Tool Kit Click here and download it now
May 26th, 2015 5:27pm

I found that it is not a good idea to use sql for videos?

Hello,

It depends on the file size. You can store files with size around some MB as a BLOB in a SQL Server database without any issues.

For large file we have FILESTREAM (SQL Server) as an other Option, the file are stored "outside" the database and you can access then by T-SQL as well as with Windows Filestream API.

May 27th, 2015 2:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics