Jump to content

[SOLVED] Uploading files to directory structure vs. storing in DB


bcamp1973

Recommended Posts

Just curious...i'm creating a CMS that manages documents (.txt,.doc,.psd,.jpg) among other things. I know files can be dumped into a database, but i'm wondering if it makes more sense to drop them into directories on the server instead for performance or other reasons?

That definitely makes sense.  I'm guessing the average file size is probably going to be under 100k so it won't be a huge difference I imagine?  I won't be dealing with high user loads either.  hmm...decisions, decisions :)

You can store the files in the filesystems, and store metadata in the database.  Then you get the best of both worlds - the power of SQL for searching metadata, plus the efficiency and ease of use of a filesystem for the files.

 

Binary data is certainly better suited to the filesystem than a database.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.