Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I rebuild my PHP website with a document database in order to improve performance?

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?

like image 951
Chris Avatar asked Oct 18 '10 16:10

Chris


1 Answers

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.

like image 185
Rob Fonseca-Ensor Avatar answered Sep 24 '22 06:09

Rob Fonseca-Ensor