Re: Uploading Files Should I use MySQL or Server for storage?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 20 May 2007, Robert Cummings wrote:
> On Sun, 2007-05-20 at 23:11 -0500, Larry Garfield wrote:
> > A well-optimized and load balanced database-based setup will beat a badly
> > configured file system setup, sure.  But will it beat a well-optimized
> > and load balanced file system setup?  I would be very surprised.
> >
> > Really, it comes down to this, assuming you know what you're doing either
> > way. Using a database and PHP access script will add overhead to the
> > process. Period.  There's extra script execution time, database
> > connection time, database read time, and pass-through time.  Plus memory
> > overhead on all of those, and coding/debugging time and effort.  What you
> > get in return is more places to programmatically control and log things;
> > access-controls for whether or not a user is authorized to see a file,
> > potentially more detailed access logs than you can get from simple apache
> > logs, etc.
> >
> > Sometimes that trade-off will be worth it for whatever it is you're
> > doing. Most of the time, it probably won't be.  Decide based on what it
> > is you're doing.
>
> Yep, I never said database was necessarily superior, only that anyone
> with any skill whatsoever isn't going to be hammered by a 1/3
> performance penalty for using the database. As you said... it all
> depends on what you're doing. As for all the penalties you mentioned
> above, you may be incurring these anyways if you have any kind of
> logical control of the files since you probably have to hit the database
> for file access permissions, or meta information, etc, etc.

On the request to generate the link, yes.  But in the browser if it's given, 
say, an image URL, it has to make a new HTTP request back to the server to 
get whatever that URL is.  If that URL is a PHP script that returns an image 
out of a database it will be slower than if it's a URL to a file sitting on 
disk.  That's where the performance loss is.  Whether or not that's a 
worthwhile trade-off is a case-by-case question.

-- 
Larry Garfield			AIM: LOLG42
larry@xxxxxxxxxxxxxxxx		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux