I know this question has been asked any a times.
I read this whole post but still couldn't reach to a point.
I am making a website which will allow users to download the wallpapers and songs. No one else will upload those wallpapers/songs except me. I mean to say that the users will not be uploading them. At present. Each file on an average is 6Mb(for songs).
Now, what would you prefer to do here? Store them as blob files or use file paths?
In My opinion you should store path in instead of blob. But again it depends upon many other things - Do you have your own server? or you are hosting it on somewhere else ? Are these things really critical to put as blob in DB ? What will be your backup strategy etc..
I have my own reasoning
Also keep in mind when you have to take backup of your database it may be a big headache at some stage. On the other hand if your songs file are on disk then it will be easy.
Also if you are storing just the path in database, you can consider to keep your songs and picture on some other server (or multiple servers) as well.
In short, I can see many advantages to use file system to store songs and pictures.
it really depends on what you're doing.
if you use file paths, then you have to have different and consistent security setup on that path. you also have to do something to enforce unique filenames, etc. you also need to set up backup for that directory as well
if you use blobs, the database handles security for you, backup should be consistent with everything else in the db.
you might store them as blobs in a different table, with a FK from the first table to the blob table. then you can avoid storing the same blob multiple times, etc.
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