You are here: Re: photos stored in database or as files « PHP Programming Language « IT news, forums, messages
Re: photos stored in database or as files

Posted by Jerry Stuckle on 06/13/07 11:52

Christoph Burschka wrote:
> Jerry Stuckle schrieb:
>> Databases work well with huge numbers of images - they're made to
>> handle large numbers of rows. File systems aren't. 100K rows to a
>> database is nothing. But try to put that many files in one directory.
>>
>
> Databases are meant to store huge *numbers* of records that can be
> quickly indexed and searched. They're not meant to store big blobs of
> binary data.
>

And where did you get that from? They work just great for images.

> So use the appropriate tool for *each* part of the job.
>

I do.

> Nearly every good CMS that handles images will use a folder in the file
> system combined with a MySQL table of file names. There is no practical
> limit to the number of files in a file system; the only performance
> issue you get is when you try to list all of them at once or search for
> one.
>

So "nearly every good CMS..."? What does that prove? Absolutely
nothing, maybe? And when was the last time you tried to handle 100K
pictures in a single directory? Databases handle this quite easily.

> But give it a specific path (which MySQL found in its table in an
> instant) and the file system will find your file immediately, regardless
> of how many other files there are in the directory.
>

No, it won't. Try putting 100K files in a directory and see how long it
takes to find one. Also, see how much space they take. Unless they're
each a multiple of 512 bytes, you'll get a lot of wasted space.

Now repeat with MySQL. Not only will retrieval be faster, the files
will take less space.

> --
> cb

You've obviously never tried it, have you?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация