views:

87

answers:

2

Hello,

We have a website developed in PHP with MySQL and sometimes facing problems when traffic increases. We have almost optimized the site in all ways to handle more requests but still facing problems at peak hours.

One of my friends suggests to rebuild the site using HBase / MongoDB as back-end to improve the performance. Also he suggests that if we rebuild it, we can easily move to cloud services. But we need to learn entire thing and redevelop it.

Is it better idea to do so?

+5  A: 

The first thing to do is to profile your web app to determine what the bottleneck is.

If it's definitely queries to the database, then replacing mysql with mongodb might be a good idea, but document databases work in a different way to relational ones, and you might have trouble porting some types of functionality. If you do decide to try mongo, prototype early and often, because there's no garuantee it will be faster for you.

If scalability really is a problem for you, then why not jump straight into a cloud-based web architecture like google app engine. This is java or python and document database (bigtable) based, but forces you into a scalable "cloud" architecture from the very beginning.

Another option is to simply introduce (or optimise) caching (with memcache) - this will have less architectural effect on your application therefore take less effort.

Rob Fonseca-Ensor
We use LAMP. We did not profile my website till now. We just followed some optimization tips. Please suggest me the tools to profile.
Chris
I've not actually tried to profile any LAMP systems before, maybe ask another question on stack overflow? You'd probably need different tools for apache, mysql, the server's CPU, the server's network access etc.
Rob Fonseca-Ensor
And depending on what you mean by "problems", maybe you need to profile from a browser too, such as with firebug. +1 to col shrapnel
Rob Fonseca-Ensor
A: 

There are simple MySql scalability options out there too. Back in the "dark days", we'd just throw dedicated hardware at the DB as step one, more recently, clustering became possible. There's also cloud-type solutions that are MySQL based you could use. For instance, Amazon's RDS claims to work with all the same commands as MySQL and also claims to be an easy conversion.

Before you get down to all that, I'd recommend optimizing, indexing, and profiling. I've run PHP/MySQL CMS-based sites with 1 million+ uniques a day with no need to go to the cloud. The code is the key.

bpeterson76
Throwing more hardware can still be a fine solution.
TTT
it's a great solution for incompetence - agreed.
f00