Comparing Web Frameworks DR. MOHAMMAD IQBAL THANKS TO ADITYA SENGUPTA Web Frameworks? PHP Frameworks Zend CodeIgniter Symfony CakePHP Yii Kohana Drupal* Wordpress* Ruby on Rails Django Why PHP? Why not PHP? It’s easy: Easy to learn Easy to run Easy to find PHP developers 75% of web sites run on PHP Powerful Extensible Open source Why PHP? Why not PHP? xkcd.com/292 by Randall Munroe Comparing Frameworks Default installation as per instructions on the official website of the framework Except using SQLite as opposed to MySQL as the database engine Basic website as per the tutorial/getting started document for the framework Login/Authentication functionality added if not available in the default tutorial Performance testing for one static page, a large dynamic page and a login page Functionality Compared LICENSE REQUIREMENTS CONSOLE TOOLS DOCUMENTATION TUTORIALS Zend Framework Open source (New BSD License) Object Oriented M-V-C Architecture Requires PHP 5.2.4 or later Optionally PHPUnit 3.0 Database agnostic Zend Framework Provides a console tool (zf) for Rapid Development Automagically generates models, controllers, layouts and views Does not automagically generate SQL Does not automagically create CRUD functions Poor documentation Default tutorials don’t provide Authentication or Security related examples CodeIgniter Is not completely open source (CodeIgniter license) Requires developers to indemnify the company Object Oriented M-V-C Architecture Requires PHP 5.1.6 Database agnostic Does not support SQLite3 natively CodeIgniter No console tool No automagic generation for any functionality Extremely small download (2.2MB) Does not provide a text tutorial on the site (only video tutorials) Tutorials on the site use older versions of CodeIgniter class xyz extends Controller (v 1.x) class xyz extends CI_Controller (v 2.x) Default tutorials don’t provide Authentication or Security related examples Symfony (1.4) Open source (MIT license) Object Oriented M-V-C Architecture Requires PHP 5.2.4 Symfony2 will require PHP 5.3.2 Database agnostic Uses doctrine or propel for the Object Relational Mapping (ORM) layter Symfony (1.4) Extremely powerful console tool (symfony) Automagically generates all elements including sql queries (from YAML source) Provides extremely detailed tutorials for all functionality Tutorials work as documented The basic tutorial includes admin functionality as well as authentication and security information Plugins are extremely easy to install using console tools. CakePHP Open source (MIT license) Object Oriented M-V-C Architecture Works with PHP4 (4.3.2) Database agnostic Does not natively support SQLite3 CakePHP Console tool (cake) cake bake generates code if a database is defined including models, views and controllers for the tables in the database cake schema is used for database backup/restore functionality Separate tutorials for a weblog and ACL controlled applications. Tutorials work as documented Yii Framework Stands for Yes It Is! Open source (BSD license) Object Oriented M-V-C Architecture Requires PHP 5.3 Database agnostic Yii Framework Powerful console tool (yiic) Does not generate SQL Uses Gii (web based code generator) for CRUD operations Default yii application as generated by yiic includes authentication functionality and three basic pages Tutorials are regularly updated Kohana Open Source (BSD license) Originally based on CodeIgniter, but no longer Object Oriented M-V-C Architecture Requires PHP 5.1.6 Database agnostic Does not support SQLite3 natively Kohana No console tool No automagic generation for any functionality Extremely small download (1.1MB) even smaller than CodeIgniter Documentation is poor. Most basic information like database connectivity is not available on the user guide for version 3.1. Tutorials are extremely limited (no tutorials for v3.1) Ruby on Rails User Friendly (27 June 2008) by J.D. “Illiad” Frazer Ruby on Rails Open source (MIT license) Object Oriented M-V-C Architecture Provides its own server but using Apache with Passenger may uninstall PHP5 on Ubuntu Database agnostic Ruby on Rails Multiple console tools (rails and rake) Databases can be managed via console tools with YAML configuration files Automagically generated code includes CRUD functionality however the Rails Guide notes that experienced Ruby developers rarely use it Default tutorials use plain http authentication rather than database driven authentication xkcd.com/353 Django Open source (BSD license) Object Oriented Model-Template-View design (same as MVC) Provides its own server but can integrate with Apache or any other server Database agnostic Django Uses python manage.py as a console tool Automagically generates sql and admin functionality Can use console tools to manipulate data Tutorial is basic but well written. There is a “coming soon” at the end of the tutorial Admin functions are behind login pages, but the tutorial does not show how to create login pages for the public site Performance Compared JAKARTA JMETER 2.4 VMWARE WORKSTATION 7.1 WINDOWS 7 BASIC Static Page 18000 16000 14000 12000 10000 8000 6000 4000 2000 0 6000 5000 4000 3000 2000 1000 0 Average (ms) Median (ms) Throughput (req/min) User/Administrator Login 25000 4500 4000 20000 15000 10000 5000 3500 3000 2500 2000 1500 1000 500 0 0 Average Median Throughput 101 Blog Entries on a Single Page 60000 3500 50000 3000 40000 30000 20000 10000 0 2500 2000 1500 1000 500 0 Avg Median Throughput Selesai! ADA PERTANYAAN ?