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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With