Image files vs. image blobs
Moderator: General Moderators
-
chris12295
- Forum Contributor
- Posts: 113
- Joined: Sun Jun 09, 2002 10:28 pm
- Location: USA
- Contact:
Image files vs. image blobs
which is more efficient, creating a directory for each user and saving images as files in the directory, or saving the images as blobs in a database? It seems that blobs would be much better organized but maybe not so efficient?
- daedalus__
- DevNet Resident
- Posts: 1925
- Joined: Thu Feb 09, 2006 4:52 pm
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Yup, that's what I do. You can then use "deny from all" in a.htaccess to prevent direct access to the files (PHP will still be able to access them). Storing images in the database can really slow things down, not to mention it's harder to backup etc.ole wrote:Store metadata in the database if you need to. Images belong in files yeah. You can get large amounts of data out of files a lot quicker than databases but there are many other reasons why files are better.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK