I need to develop an app for booking appointments. This is going to be hosted in a shared server. So performance is the most important thing. I have used symfony2. I quite liked the framework. But seems to be heavy.
Which framework would suit me considering my requirements? I have shortlisted three frameworks yii, symfony2 and ZF2. I am not asking which framework is better.
All the three are good frameworks. I want to know which will suit my requirements. My first priority would be performance (I will be using AJAX wherever possible), second would be maintenance and development time and third community support. Or should I use my own handlers to separate views and logic and just use raw php?
7
Performance isn’t your most important factor. If it was, your app wouldn’t be hosted on a single shared server, it would be hosted on a cluster of dedicated servers.
If you want to do the best job you can on this project, then use whichever framework you already understand best. You’ll better know how to get good performance out of it because of your experience with it, and that may make up for whatever advantage some other framework has.
It’s likely the code you write will have the most impact on performance.
Also, it’s likely your app won’t see enough traffic for this to really matter. In the event it does, at some point you’ll want to move it off of a shared server to a dedicated server, regardless of what framework you use. Eventually you’ll be running it on a cluster of servers with a load balancer in front of it, and your challenge will be things like how to shard your database.
Edit:
Here are some benchmarks of a variety of PHP frameworks, which include both symfony and yii, and zf1 but not 2.
In that particular benchmark, it looks like symfony2 is faster than yii which is faster than symfony1, which is faster than zend. They’re all of course slower than raw html or raw php.
I think choosing a framework based on a benchmark is a bad idea though. Your own code will be doing something different, and perform completely different.
You might find their methodology useful though. You might want to run siege yourself and see how well your site performs, and what difference making various changes makes. (Although if you’re on shared hosting, you probably shouldn’t run siege against it, you might bring down everyone’s site!)
For “maintenance and development time”, your familiarity with the framework is probably going to matter more than the framework itself. And your own ability to be productive and write maintainable code is even more important, regardless of framework choice.
Good luck on your project!
4
@tim’s answers is the best one I think but if you still need to pick a PHP framework, then consider Codeigniter too. It works very well on a shared server, no command line access needed, very good performance and a large active community
I think YII best meets your requirements since:
-
it is fast
http://www.yiiframework.com/performance/
and even more so if you can implement APC which I was able to do on shared hosting provider blue host using the instructions here: http://rk.md/2011/install-apc-accelerator-bluehost-shared-host/
This speed will allow you to stay longer on a shared host before exhausting resources. -
Maintenance is simple by pointing the index file to the latest install, with regression equally simple.
-
Development time is short due to excellent scaffolding provided by the GII module http://www.yiiframework.com/doc/blog/1.1/en/prototype.scaffold
-
Community support is strong with active forums, wiki and extensions.
With the caveat that if you already know Symfony then that will be easiest for you to use, however that is not one of your stated requirements.
4