views:

118

answers:

3

I am developing a web application which is using php. It will use the mySQL database for storage. But The application may upgrade in future, so I would like to know is there any framework for me to reduce the pain of upgrading database structure. I know that there is a framework called cakePHP. And the application will deploy in more servers in the future, clusters, is there any special need before the application start writing. Thank you very much.

A: 

Hi,

if you want to use an Framework, i would suggest the Zend Framework from the makers of PHP. If you only need to switch the database server in the future:

use PDO for Database querys/connections. PDO is included in PHP5 and allows you to switch from (example) MySQL to MSSQL , or from SQLITE to MYSQL.

Zend Framework

PDO on Wikipedia

ArneRie
A: 

I'd recommend ruckusing to track your database schema. CakePHP has its SchemaShell which is supposed to do much the same thing, but I found it doesn't work too well.

As for scalability, there are a number of things to consider which are hard to list here. A framework like Cake can help you abstract some things away which may help later when scaling to more servers. For example by using Cakes SessionComponent, you can abstract sessions away entirely and later switch from PHP session handling to storing sessions in a central database, which may or may not be a significant hurdle when wanting to scale up.

deceze
A: 

CakePHP is a great framework, but if you expect your web app to scale to higher traffic in the future, I am not entirely convinced how well CakePHP will handle larger loads.

I suggest trying out Yii, which is similar to CakePHP, but provides built-in support for caching solutions like APC and MemCached, which will provide huge benefits to reducing database load when you have heavy traffic.

Here's a very detailed and thorough introduction & tutorial to get started with Yii:

http://blog.dmcinsights.com/series/learning-the-yii-framework/

And here's a link to a programmer's blog explaining why he chose Yii over Zend or CakePHP that you might find helpful:

http://blog.ryanlahue.com/2009/12/yii-framework-choosing-best-web.html

Hope this helps!

Bug Magnet
No framework can help with highload without understanding.
Col. Shrapnel
What he said. Also, while I agree that Cake can be a heavyweight, it supports several different caching strategies and should be very competitive when set up properly. If you get into territory where the number of requests brings your server down, no framework will magically scale just by flipping a switch.
deceze
I'm with you and I agree that improving performance requires an understanding of the framework. But overall, Yii does make it a bit easier to scale than CakePHP because it supports lazy loading and also has built-in support for APC/Memcached, which potentially means you will have fewer headaches when you do need to scale and start implementing a caching solution as the Yii developers have thought about these issues and built them into the framework from square one.
Bug Magnet
http://github.com/cakephp/cakephp/blob/1.3/app/config/core.php#L249
deizel
Nice. I stand corrected.
Bug Magnet