peterhf wrote:
> I have been influenced by the argument given a sites such as
> http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/. There
> is a logic to me, that having the image and the data surrounding the
> image are in one place, not devided between two places which would
> require attention to not allowing the two from becoming out of sync.
>
> I am certainly open to opposing views as I am new to dealing with
> large quantities of images.

I'll chuck an opinion in :).

Sticking large numbers of image files in a db is handy in that the
data is all in one place, but awful from several other perspectives.
Storing the file path/meta data in the db so you know where things are
and you can treat them as an object (i.e. link a user to an image or
whatever) makes sense; to me putting the image data in the db is just
an overcomplex means of achieving an inefficient solution. Unless you
have a very good reason to do so, and it would have to be a reason
that serving image files (which are outside of the webroot) with php
doesn't solve, it would be best avoided.

disadvantages I can think of:

1) Php serving an image is slower than just letting apache doing it,
and significantly more so if you have to get the image source from the
db.
2) You add dependencies to the db (and php if appropriate) you
otherwise don't have to serve images
3) php's image functions work only on files afaik
4) It's going to take up more space in a db than it would on the file
system
5) A db field has a size limit per file, a file system doesn't

I'm sure there are more. If anyone has one of those "very good
reason"s I'm game to be enlightened ;).

hth,

AD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to