Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to store and retrieve big video files for a web based app? [closed]

I am making a video sharing site. What is the best way to store lots of big video files, so that it will be fast and performance efficient while accessing them?

A colleague said that storing as files on hard-disk folder is not going to be efficient as it will be very slow on many read/write operations.

Someone else suggested storing them in MySQL blobs.

like image 514
Arshdeep Avatar asked Nov 04 '10 17:11

Arshdeep


People also ask

Where we can store video?

Google Drive It offers plenty of storage for free, so you can test out their service risk-free while you compare your other options. Another great benefit to using Google Drive is that it syncs with your Google account and is easy to access across devices. Let's look at some of their features.


2 Answers

Generally storing large files in a database is not considered good practice. See this question and those linked from it for further info.

Rather than simply storing on disk, you may wish to consider using a service such as Rackspace Cloud Files or Amazon S3 if your budget allows.

like image 155
William Avatar answered Oct 29 '22 22:10

William


Use your ID key in the database to sort files into folder.

Take the first number, put that in first directory, second number in next.. and so on:

ex:

18

/videos/1/8/MyvideoFile

1892

/videos/1/8/9/2/MyVideoFile

Alternatively you can also sort them on various servers or NAS clusters by storing a server number in your DB.

Hope that helps.

like image 33
Brian Smith Avatar answered Oct 30 '22 00:10

Brian Smith