At 1:02 AM +1000 5/11/06, Peter Hoskin wrote:
Despite common belief, SQL is not suited to the storage of binary files.
SQL is based on ASCII.
Store your files on the filesystem, not SQL.
How is it not suited?
I stopped using mySQL to store images because of
browser refresh problems, but other than that --
I didn't find any major problems with using it.
Plus, moving images from one system to another
was much easier because you just moved the dB and
you don't have to worry about the file system and
breaking links.
In addition, if you are using multiple hosts, who
require the same images, then using mySQL is far
superior than trying to keep all the images in
different file systems synchronized.
Furthermore, according to Paul DuBois (author of
MySQL Cookbook, great book btw) who says "If you
store images on the file system, directory
look-up my become slow" in his comparing file
system to mySQL for image storage.
Additionally, transactional behavior is more
difficult with a file system than it is with
mySQL.
Granted, if you use mySQL for storing images,
then you bloat the tables and approach your
system limits faster than using a file system.
But for a limited amount of images, there isn't
any real problems.
And granted, pulling images from mySQL to be used
in web sites are slightly slower and present
refresh differences between some browsers, but
that's certainly not a reason to say that mySQL
is categorically not suited for the storage of
binary files -- like with everything else, there
are trade-offs. Do you not see that?
---
At 1:53 AM +1000 5/11/06, Peter Hoskin wrote:
So, if ASCII and Binary are both codesets... which does SQL use to store
its data?
Is ASCII stored differently than binary on a hard drive?
From my limited experience in using a hex editor,
the data all looks the same to me. If it wasn't
for my hex editor, I would be looking at 1's and
0's, right?
After all, isn't an image in a file system stored
on a hard drive the exact same fashion as an
image stored on a hard drive via mySQL?
The only difference I can see is in overhead --
but then again, I may be a Moron or an Idiot like
Rory Browne suggests.
Perhaps someone might enlighten me as to why
mySQL is not suited to store images -- and prove
it.
And for goodness sake NO, Google is NOT always
right -- it's only a collection of everyone's
view. When did Google replace valid research? I
can see tomorrow's mother's saying to their
children "If Google jumped off a bridge, would
you do it?"
Let's get real about what Google can offer.
Specificity is inversely proportional to the
number of people voicing an opinion. I would
guess that even Morons and Idiots know that.
tedd
Typical disclaimers apply -- I did not mean to
offend anyone nor to imply that anyone is an
Idiot or a Moron. Your mileage may vary. No
warranties expressed or implied. This is not a
solicitation for an investment opportunity.
Consult you doctor before applying. No hable
inglés.
--
--------------------------------------------------------------------------------
http://sperling.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php