Re: Lookup domain in directories VS database

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

 



2009/7/5 Martin Zvarík <mzvarik@xxxxxxxxx>:
> Imagine you are hosting 10.000 subdomains.

    Consider it done.

[snip!]
>
> Everytime visitor hits the page you do:
>
> @include('t/test-subdomain.freehosting.com/conf.php')
>
> if (!isset($CONF)) die('such a subdomain does not exist');

    .... vs....

> Everytime visitor hits the page you connect & search in a MySQL table having
> 10.000 rows with each domain name and a text field (export_var()) that has
> some parameters you need.

    Okay.

> What's better?

    This depends on so many external variables that it's really
impossible to give a good answer.  However, while there would be less
overhead to read a small file, I would not give the user the option to
modify a local PHP file (your first solution), which they could do if
it was stored in their local directory.  Conversely, moving it outside
of the user's directory and allowing them to read it from a central
location opens your sites up to some major XSS issues.

    So a properly-indexed database would most likely be your best
solution, based upon the limited information we have here so far.  All
in all, if you're running the server as a host with thousands of
sites, you are probably better able to better decide what's in the
best interest of yourself and your users considering the above.

-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at
http://twitter.com/pilotpig

-- 
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