Lots of good ideas. One other thing to consider when designing this is the possibility of multiple web server accessing a single database server.
If you use the file system method which assumes that the web/db are on the same server as soon as you want to have multiple web servers you'll run into problems. Of course you also probably don't want to have multiple web servers ask a single db server over and over for the same image. Especially if mysql's blobs are inefficient (I don't know if they are or not). You might consider storing the images in the database, and then setting it up so that it first checks the filesystem and if it isn't there, gets it from the database and caches it to the filesystem so the next access it fast. This would allow you to run multiple web servers since they could both cache them locally. For what it's worth, for our application we use a two level directory heirarchy of [0-9]/[0-9]/primary_id.jpg. Works well for us. -philip On Wed, 21 Aug 2002, Scott Houseman wrote: > Hi there. > > Which way would be the most efficient/fastest to access images from an image > library. > A) Store image files in a hash directory structure AND storing each file's > information in a mysql table > OR > B) Storing image information in mysql table AND storing the image in a BLOB > field in that table. > > The way I see it, considerations to be taken into acount: > - Is it quicker/better to retrieve image from table & then stream out to > browser OR simply direct the browser to the file? > i.e <IMG SRC="/imagelib/image.php?iImageID=10"> OR <IMG > SRC="/imagelib/5/f/10"> > - Will a database OR filesystem be more scalable i.e. which wil perform > better when there are 10000 images in the libary? > > Thanks in advance > > Regards > > -Scott > > -- > Scott Houseman > Jam Warehouse http://www.jamwarehouse.com/ > Smart Business Innovation > +27 21 4477440 / +27 82 4918021 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php