Put images into database or not? [SOLVED]

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
50cc
Forum Newbie
Posts: 2
Joined: Mon Feb 05, 2007 2:39 pm

Put images into database or not? [SOLVED]

Post by 50cc »

I am building a site where users can upload pictures. I was wondering which would be better save the uploaded images as 'normal' files or putting each image into a MySQL database. Putting all the images into a database would make it easier to backup all the data for my site. But would it have disadvantages?
Last edited by 50cc on Mon Feb 05, 2007 3:19 pm, edited 1 time in total.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Just store the filenames of the images in the database. Files belong in file systems. You have one at your disposal... why create another one inside of a database?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

We've talked about this a lot.. so I won't even really talk further:

viewtopic.php?t=53744
viewtopic.php?t=46301
viewtopic.php?t=39015
viewtopic.php?t=37077
viewtopic.php?t=36110
survivant
Forum Newbie
Posts: 1
Joined: Sat Feb 24, 2007 6:22 am

Post by survivant »

I read that the main problem with storing the images into the database is the overhead to retrieve the images using a php script. If I use a servlet to retreive the images, will it be better than a php script ?


I think that I'll stick with the databse to store the image path, names, description.. and keep the images into the HD for better performance, but I really want to supporte clustoring, that why I taught he database approach .

thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

survivant wrote:If I use a servlet to retreive the images, will it be better than a php script ?
Last I saw.. no.
Post Reply