Should I store pictures in a database or just in a folder.

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Redlightpacket
Forum Newbie
Posts: 3
Joined: Mon Jul 30, 2007 7:08 pm

Should I store pictures in a database or just in a folder.

Post by Redlightpacket »

I plan to make a huge website that will store several thousands of pictures or more. I'm wondering which direction I should go in. When it comes to storing pictures in a database or in a file directory. Thanks.


Chris Clark
Redlightpacket@gmail.com
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 ad nauseum. Files go in directories.
User avatar
swiftouch
Forum Commoner
Posts: 80
Joined: Sun Dec 10, 2006 7:35 am
Location: Salt Lake City, Utah

Post by swiftouch »

Store the filename, picture name, etc, in the database. Store the physical file in a folder on the server. At least that's the way I've always done it.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Use the filesystem - the number of times an image needs to be buffered and streamed between Apache/PHP/MySQL is just too expensive. Use the database only to keep a record of images and their locations so the collection is manageable. Otherwise just leave them to Apache alone to retrieve.
Post Reply