Storing files in the database or the filesystem?
Posted on July 7, 2008
Filed Under blog |
Storing files in the database or the filesystem? Take a look at wikipedia’s server layout diagram.
Ok, take a good look at the diagram.
I could not think of any applicable situation where storing files in the database is the best way. Maybe for small applications you could use the database for storing files but then when it grows, changing it to the filesystem will just add lots of headache in the future. Why not do it right from the start?
"Too many inherent problems in storing binary data in the database, IMHO. The database is for data, and the filesystem is for files."
- Best way to store file with SQL server as its database
Youtube, Wikipedia, uses filesystem to store files. And it works. Do we have time to try out methods that doesn’t work? Maybe it could work, but the down the road, the pain that must be endured.
Here’s some points on filesystem vs database thing (taken from other sites).
- having the images in the file system allows you to access the images from many different standard applications (FTP, web browser, etc) without having to write application code to pull the data out of the database, since you can’t just ‘SELECT image FROM table’ and have the image appear in Enterprise Manager or Query Analyzer.
- Queries retrieves rows, including the blob, into memory.
- References, take a look at:
Comments
One Response to “Storing files in the database or the filesystem?”
Leave a Reply

[…] - bookmarked by 3 members originally found by predatorgirl on July 17, 2008 Storing files in the database or the filesystem? http://mkhairul.com/2008/07/07/storing-files-in-the-database-or-the-filesystem/ - bookmarked by 2 […]