Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store audio files in server (during hosting)

I was thinking of building an app to serve audio content. The first question I get is how to store it. Two obvious solutions that occur are:

  1. Dump in database as BLOB
  2. Dump in filesystem, and store path in DB

There was a similar question here and the answer urged to store in file-system. I can think of at least one disadvantage of storing in files, i.e. I loose all backup, recovery and other awesome features of databases.

Also I wanted to know how both solutions would fare in terms of scalability.

Does anyone know how flickr or youtube does it?

Or does anyone has even more creative(scalable :)) ideas?

like image 759
Suraj Chandran Avatar asked Dec 13 '22 15:12

Suraj Chandran


1 Answers

Your file system should have backup and recovery procedures setup if this data is important. (The rest of the application is backed up right?). So you shouldn't use a database just for the backup and restore capability.

Storing the files outside of the database allows you to separate your database and file servers which will be a plus on the scalability side.

like image 143
jzd Avatar answered Jan 07 '23 09:01

jzd