Reply to Re: Difference between storing files on folder and in mysql db

Your name:

Reply:


Posted by Jerry Stuckle on 01/09/08 04:12

Rik Wasmus wrote:
> On Wed, 09 Jan 2008 05:05:21 +0100, Jerry Stuckle
> <jstucklex@attglobal.net> wrote:
>
>> NC wrote:
>>> On Jan 8, 8:56 am, missmoo <mor...@gmail.com> wrote:
>>>> I would like to know what the differences are in terms of security,
>>>> reliability and resources between storing user-uploaded images in a
>>>> file or storing them in a mySQL database.
>>> The only significant difference is the DB server load. Since <img
>>> data="*"> tags are not (yet?) commonly supported by browsers, you need
>>> a separate instance of an image display script (and a separate
>>> connection to the DB server) to display each image. So if your Web
>>> page has 100 images on it, it will require 101 nearly simultaneous
>>> connections to display itself and the images, as opposed to one
>>> connection if images were stored in the file system. Granted, image
>>> retrieval connections would be very short, but at high loads, this
>>> architecture would be patently inferior to disk-based alternative.
>>>
>>
>> Not true. <img> tags are handled identically by the client, whether
>> the image comes from the database or the file system. The client
>> doesn't know or care if the image is from a database or not.
>
> I think NC is talking about 'in this scenario, for every image request a
> database connection is opened and closed again'. Which is true, unless
> one uses persistent connections.

True - a database connection is opened and closed. But as discreet
files, a file system connection must be opened and close - something a
lot of people ignore.

My point being that a network connection does not need to be opened and
close.

And either way, if it's a commonly used image, the cache (database or
file system) can produce the image. In fact, the database cache could
be more efficient, as it doesn't have to cache unrelated files, such as
scripts.

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

[Back to original 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

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