SQL Server 2008 FileStream vs Normal Files

I am creating an application such as youtube for storing videos and I need some advice.

Should I use SQL Server FileStream to store video files or store them somewhere on my hard drive and write the path as varchar (MAX) inside SQL Server?

What is recommended and why?

Do you recommend something other than both of these? Please feel free to tell me, but please tell me why, too.

Thank you very much.

+4
source share
3 answers

The FILESREAM type has the advantage of providing transparent transactions while maintaining large files in the file system. The disadvantage is that it is patented, and if you decide to change the database, this solution may be less portable for other databases. Therefore, providing an objective answer to this question is impossible IMHO.

+9
source

I would save them outside, simply because they do not need to immediately and urgently store them inside. In addition, the videos are large, and you may need to run them through some other coding steps, etc., which may or may not look like SQL Server. Using basic files also gives you the ability to distribute this load to any number of file servers, rather than to a single SQL Server.

Follow the path; do not save the full path - just save some path relative to the external root that you configure in your application. This way you can move all the files and just change the settings of one site, instead of doing a big UPDATE . For example, in the database, I could store foo/bar/20110404_27.mpg , and then combine this with the site setting \\myfileserver\share (using Path.Combine ).

+8
source

Source: https://habr.com/ru/post/1346735/


All Articles