miushock
miushock

Reputation: 1097

How videos are stored on web server these days?

I'm building a web app that need to store some resources, including but not limited to articles, pictures and videos. My question here is how videos (mp4/ogg) are stored on web server? just as bare file or as binaries in relational or nosql db?

Upvotes: 5

Views: 3169

Answers (3)

Anatoly
Anatoly

Reputation: 15530

An unlimited file storage is difficult to setup without AWS S3. S3 is cheap and scalable solution but expensive to use without proper caching, so we have Nginx S3 proxy that works well: https://stackoverflow.com/a/44749584/290338

Upvotes: 0

b2Wc0EKKOvLPn
b2Wc0EKKOvLPn

Reputation: 2074

I think you need to elaborate a bit about the use case you wish to implement for this app. Only then you can have precise answer.

And to to help out with that, here are some questions you need to ponder:

1- You said you wanted to store videos, what are your requirements beyond storage?
2- do you wish for example to offer access to third party users to these videos and search with keywords?
3- If yes, what kind of information is available about the videos? what is the expected average size of these files?

Many database engines offer the possibility of storing big binary files, but that comes with an impact on performance. That's why most of the storage systems that deal with big files, store the files themselves on the disk and any related metadata (file name, last updated, associated keywords, etc.) are stored in the database. That makes for a scalable system.

I'll edit this answer, if you find it useful and have further related-questions.

Upvotes: 3

OneChillDude
OneChillDude

Reputation: 8006

The question to BLOB data almost always comes down to "don't BLOB data". There are very few times that make more sense to write a database connector for your data then to just keep it on disk.

The general trend is to use an established service that employs good design patterns, such as Paperclip for ruby, and tailor it to your needs.

Using an external storage service is also a good idea, for example Amazon S3 will store all of your data for pennies on the dollar per gigabyte, and they'll do an excellent job of it.

If you do decide to cook up your own server that handles data internally, might I recommend digital ocean? I have been very happy with the SSD servers I have setup there (which are super fast).

For video you will almost certainly need a webserver that is capable of streaming the file. I think Nginx has this feature.

Upvotes: 4

Related Questions