I've been working with MySQL for a while now, but I've noticed it can be slow at times and most websites with dynamic content tend to be slow if there are a lot of users online. I've also noticed how on static websites things generally load more quickly. Static pages are, however, restricting, and this brings me to my question:
Would getting data from a combination of MySQL and text files put less strain on the server than just MySQL?
There are some little things which some people like to put into databases--the current users online, for example--which just seem silly to me and seem like they would put more strain on the server than just looking through a text file.
Name:
Anonymous2006-02-22 4:52
You could do this, but the effort required for a mixed solution would make it pointless in my opinion. Try optimizing your SQL queries and implementing a more aggressive caching strategy.
>>3
They're not little useless things though, they're just little things that I do not need to waste MySQL queries on--that is, if a text file would be better.
>>6
And just to add onto this...My thinking initally was that if there are a lot of people using a part of the site which requires a lot of SQL (namely an imageboard or forum) then I don't want to waste any SQL queries/slow the database down.
Name:
Anonymous2006-02-23 13:12
>>6
It wouldn't be really better, unless you can cache them (and you can cache them in the database too).
Anyways, a database is much faster than you think; benchmark it because if you have performance problems my experience says it's most likely due to the application server (PHP or whatever) taking the CPU time itself. And you can always scale.
Name:
Anonymous2006-02-24 13:12
| Anyways, a database is much faster than you think;
You haven't tried Oracle, have you? And the legions of "database programmers"
Name:
Anonymous2006-02-25 10:46
>>10
I didn't mess with Oracle much, but I'm currently working on a PHP-based portal. The main page makes well over a hundred queries, and is served in 0.25 seconds. I once thought it was insane and it was making the portal slow, so I worked on a hack to save 15 queries. It was then served in 0.24 seconds.
php has to load up and parse pages as you access them as well, this can also be cached but it does give a bit of a performance hit.
you may consider running some sort of site-wide caching, which will capture the output of pages and essentially serve up static content unless stuff changes - this will help with commonly accessed pages.
Name:
Anonymous2009-01-14 4:26
Caching is useless for overly dynamic content. For everything else it increase performance