I am developing a web application which is using php. It will use the mySQL database for storag开发者_运维问答e. 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.
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!
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
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.
精彩评论