Welcome to WebmasterWorld Guest from 126.96.36.199
Forum Moderators: open
I have noticed it's better to put the blobs in their own table so the rest of the customer data doesn't pay for the table size increase if you need to look that up.
Also, highly consider writing a caching system so you don't keep loading the image data out of your database.
Here are my reasons -- I'm curious to hear what you think of them. I'd love to get a friendly debate going about this:
#1 Extra hardware complexity: Many things I build run with multiple web servers. To store images on the hard disk, I'd need a shared storage device. It's simpler and requires less code to store them in the database.
#2 Referential integrity: My database can use foreign keys to verify the image blob actually exists. This prevents the images from becoming out of sync with the database.
#3 Ease of backups: I just back up my database. Source code is protected with subversion/cvs/perforce. No need to back up an images directory and keep that in sync with the DB.
#4 Reversability: If you change your mind later, you could always export your database to disk and drop that table.