views:

18

answers:

1

What approach is considered to be the best to store and manage video files? As databases are used for small textual data, are databases good enough to handle huge amounts of video/audio data? Are databases, the formidable solution?

Apart from size of hard disk space required for centrally managing video/audio/image content, what are the requirements of hosting such a server?

+1  A: 

I would not store big files, like videos, in the database ; instead, I would :

  • store the files on disk, in the filesystem
  • and only store the name of the file (plus some metadata like content-type, size) in the database.


You have to consider, at least, those few points :

  • database is generally harder to scale than disks :
    • having a DB that has a size of several dozens/hundreds/more GB because of videos will make many things (backup, for example) really hard.
    • do you want to put more read-load on your DB servers, to serve... files ?
    • samer thing when writting "files" to your DB, btw
  • serving files (like, say, videos) from the filesystem is something that webservers do pretty well -- you can even use something lighter (like lighttpd, nginx, ...) than the webserver used to run your application (Apache, IIS, ...), if needed
    • it allows your application and/or some background scripts to do some tasks (like generating previews/thumbnails, for example) without involving the DB server
    • Using plain old files will also probably make things much easier the day you want to use some kind of CDN to distribute your videos to users.


And here are a couple of other questions/answers that might interest you :

Those questions/answers are about images ; but the idea will be exactly the same for videos -- except that videos will be much bigger than images !

Pascal MARTIN
+1 @Pascal: very good answer. A database I wrote carried data about images (description, date, path or filename, etc.). The same format for videos would be applicable here.
dboarman