This has been bugging me for some time now and I finally thought I would come out clean and ask. I am aware that many realational databases can store files such as images directly into them but I don't see this done much.
Let me explain, I work for a web development agency here in the UK and I've worked there for over the past 3 years as a web developer. I have had the pleassure of maintaining hundreds of sites over that period;) Most of the sites are backed by either MySQL or MS SQL Server.
When developers want to upload, say a document as part of a database news article they will simply store the file somewhere on the hard drive and then store a reference to it in a database column. I have never seen a developer storing the file directly into the db. Is this how it's done normally. I'm just curious. The only reason I think people never store files straight into the db is because the files might take up too much space.
Please enlighten me.
Best regards, Ernest [ December 30, 2006: Message edited by: ernest fakudze ]
In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Storing a link to the graphics file (instead of inserting the whole file into the database), is:
1. faster (a disk access, vs a database connection & subsequent data transfer) 2. more efficient (see above) 3. More portable (different databases have different syntax for blob's) 4. Easier to code 5. Easier to back up
which is probably why that's the way it's usually done (except for stuff like MS Sharepoint, of course ;-))
IMHO .. PSM
Paul M. Santa Maria, SCJP
subject: Storing uploaded files straight into a database