Quantcast
Channel: michael f1337 » cake
Viewing all articles
Browse latest Browse all 5

MVC Web Frameworks: PHP vs. JVM

$
0
0

I am reviewing web frameworks for product development at Resource Interactive. Here are my thoughts. Please keep this in mind when reading the following: ALL of the statements below are OPINIONS. Please feel free to disagree. :)

Problem

We’ve been using CakePHP for 6 months, but recently it has been getting in our way on a daily basis. We need a framework that requires less irritating “patch the ORM” work, and one whose design philosophy is a little closer to ours. We’ve identified the following scaling concerns, in order of severity (for our products):

  1. Time spent developing software
  2. Time spent maintaining software
  3. Time spent training new developers
  4. Time spent “scaling up” hardware/systems

Solutions

For a number of reasons, we’ve narrowed our choices for application servers down to PHP and a JVM (probably JBoss, but which JVM isn’t material to us at the moment).

JVM

IMO, if we’re gonna run a JVM, we have our choice of the leading frameworks available. I’m not going to gush here, but I can assert that the first two frameworks provide everything we need from the PHP frameworks below and more (YMMV). Listed below in order of professional recommendation (my subjective preference would list RoR first):

Grails

Tutorial: Your first Grails Application Grails is a Rails-esque framework that leverages the Groovy language and the Spring framework. Today Grails is comparable to Rails in maturity and arguably more attractive to CIO/CTOs who like to say “enterprise,” because Groovy compiles to Java bytecode and runs native in the JVM.

Ruby on Rails (RoR)

Tutorial: Creating the Blog Application Ruby on Rails is the framework that started it all: the envy, the framework wars, and the never-ending stream of clones. Rails is arguably more attractive to hackers who like to say “USS Enterprise,” but still appease the other “enterprise” by running in a JVM via the jruby interpreter.

Lift

Tutorial: Starting with Lift Lift has been making a lot of noise lately, in no small amount due to its use of the Scala language, and Twitter’s success scaling Scala. Lift borrows design principles from Seaside, Rails, Django and Wicket. Very high performance, and like Groovy, Scala compiles to Java bytecode and runs native in the JVM. But Scala is also grizzly-looking code. Can’t they roll a DSL into Lift?

Spring

Spring is powerful and fast in its own right (without Grails), but our application runs plenty fast in CakePHP, so requests per second is not on our list of performance concerns right now.

PHP

Zend

Tutorial: Zend_Controller Quick Start If you tie my hands and force me to use PHP, then I’ll endorse Zend over the rest. Seriously, though, this framework has improved a LOT since my last gander. It juggles responses for different content-types. There is even a DB migrations plugin under development.

Kohana

Tutorial: Kohana 101 Kohana is promising, but missing content-type juggling at the controller level. Someday, I hope Kohana or CodeIgniter or Sapphire (like Zend today) will crush Cake in the “Rails clone” category, but they’re a couple/few years away, IMO. I dislike Kohana’s “template controllers”: I think the “specialized view controller” pattern points to a general misuse or misunderstanding of the “action controller” pattern.

Codeigniter

Tutorial: Codeigniter “Hello World” Codeigniter is also promising, but also missing content-type juggling at the controller level. I dislike Codeigniter’s “template regions” pattern, because I feel it breaches the separation between view and controller too easily, which can lead to developer hacks, avoiding which is part of the purpose of a framework. :P

Sapphire

Sapphire looks very sexy, but the documentation is weak, and at the moment, Sapphire is NOT independent from SilverStripe: “The best way to get started with Sapphire is by extending the SilverStripe CMS.”

PHPulse

Tutorial: PHPulse “Hello Who?” PHPulse touts incredible speed, but spectacularly fails my syntactic sugar and “love what you do” standards. IOW: It’s no fun, and no fun means we get less done. :(

Doo, Yii

Doo and Yii have a lot in common: Both are incredibly fast Rails clones written in PHP, but both also suffer from being “too light” and “too immature” for our needs.

CakePHP

CakePHP is the framework we’re abandoning: It’s just not as “clean” or “friendly” as its competitors, and the ORM is downright obnoxious IME.

Akelos

The last time I used Akelos, I abandoned it for CakePHP.

Comparisons

CAVEAT: None of the benchmarks provided are authoritative for our situation. They can’t be, by definition, because our application is not the one tested. Until we perform our own apples-to-oranges comparison, we can safely treat these as anecdotal evidence.

PHP Framework Comparison Benchmarks Summary: ZEND is 2-4x faster than CAKE. RAILS (RoR) is 1.5-2x faster than ZEND. CODEIGNITER is 2-3x faster than ZEND. CODEIGNITER is ~20% faster than RAILS (RoR).

Rails and Grails Performance Compared Grails vs. Rails Benchmark Summary: GRAILS is 2-5x faster than RAILS (RoR)

Further reading

Intro to Grails for PHP developers JVM Web Framework Smackdown: Grails vs. Rails vs. Helma A comparison of the ORM syntax for Rails, Grails, and Django A comparison of the “marketability” of Rails, Grails, Django, and PHP framework skills


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images