I would assume my understanding is correct, that the file is being read in binary form, whether it's being read off the hard disk or from binary code in the database, correct?
So, I'm assuming, again, that there really should be little difference in performance regardless of how the file data is accessed. Would these assumptions be correct? Rick > -----Original Message----- > From: Dan G. Switzer, II [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 07, 2007 9:28 AM > To: CF-Talk > Subject: RE: Image Management > > Claude, > > > >>My gut reaction is that this would add overhead, a > >dependency on the database, network traffic, etc. What are your thoughts? > > > >This sbject has been brought many times. > >You're right > >The purpose of a database is to store information in such a way that it > >can be sorted and searched > >more easily. An image file is just a bunch of binary data, there is > >nothing that can be searched or sorted > >in an image, except may be in the name of the file. > >The best tool to store such information is the file management system in > >the operating system. > >You can store anything in the database, like the file name, owner's > >name, image type, sizes, subject, key words, > >but the right place of the image itself is in some directory. > >Storing the image in the database will just add overhead without any of > >the advantages brought by a database. > > I disagree. There are some key advantages to using a database. The two > biggest advantages to using the database is all your data is stored in one > location. This means if you move your app to your server, all the files go > with it. > > This is also an important issue if you're in a clustered environment, where > trying to keep files in sync between web servers can be problematic. If the > files are all stored in the database, then there's no need to sync the files > across multiple servers. > > I would only use the database to store user created/uploaded content. > There's no point in putting static files/images that are part of the web > application itself--that would definitely add overhead you don't want. > > There's also some maintenance advantages. If you need to remove files > because the data has been deleted, you don't need to delete data in two > places (database and file system) you can just delete it from the database. > You also don't have to worry about rogue files that may or may not be > needed. > > Obviously, you can overcome these obstacles if you want to use file system. > > It can also be advantageous at times to combine the two methods. Store the > files in the database, but write them to disk for performance. This works > well for images or other files that you want the webserver to serve direct. > You can write scripts to write the images to disk if they don't already > exist. > > One other note, if you're going to be using <cfcontent /> to push the files > to users because some kind of authorization is required, then you going to > have to read that binary data from somewhere. Depending on your connectivity > to the database server, there's not going to be a whole lot of difference > between reading from a database or file system. > > Most databases have made substantial progress in BLOB/CLOB management. > > I generally use the database for storing files that the user > created/uploaded--especially when I need to serve those files via <cfcontent > />. > > For content that I would consider part of the project source (such as > images, help files, etc.) then I usually use the file system--since it's > very easy to keep those files in sync when you push out new builds. > > -Dan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292835 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

