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



On Wed, 09 Jan 2008 05:05:21 +0100, Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> wrote:

NC wrote:
On Jan 8, 8:56 am, missmoo <mor...@xxxxxxxxx> 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.
--
Rik Wasmus
.



Relevant Pages

  • Re: Selecting from Datasets
    ... SQL provider manage Connection pooling which mean whatever sqlConnection ... instance you call it's just one virtual connection with the database managed ... > If I then have a datagrid and I only want it to display Field 1 and field ... > is no longer displayed on the page, so there shouldn't be a memory ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Difference between storing files on folder and in mysql db
    ... a separate instance of an image display script (and a separate ... connection if images were stored in the file system. ... the image comes from the database or the file system. ...
    (comp.lang.php)
  • Re: Filling a Dataset
    ... import it into a database and learn how to use a fucking where clause. ... particular Dataset is built from an imported CSV rather than a database, ... It is not simply a matter of display. ... requires a connection and I don't see how to create a connection to ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Difference between storing files on folder and in mysql db
    ... a separate instance of an image display script (and a separate ... connection if images were stored in the file system. ... the image comes from the database or the file system. ...
    (comp.lang.php)
  • Re: Update3 : My experience
    ... connection to DB is closed! ... choose to display the Database Module..... ... >> Best regards, ...
    (borland.public.delphi.non-technical)