SlideShare a Scribd company logo
What’s the “right”
PHP Framework?
Barry Jones
Who am I?
• Barry Jones
• Java/Groovy/PHP/Perl developer since ’98
• Ruby on Rails developer mostly since 2012
• Formerly ran Brightball, Inc here in Greenville
– Contract programming business from 2008-2012
– 99% CakePHP…
– Built our platform “The Intersect” on top of Cake
• Software Architect with ACS Technologies, Inc
SO WHICH ONE IS IT?
The people need to know….
Is it…
• Zend Framework?
• CakePHP?
• Symfony?
• FuelPHP?
• Code Igniter?
• Lithium?
• Laravel?
• Solar?
OR….
• Kohana?
• Yii?
• Prado?
• Akelos?
• PHP Fat-Free?
• Agile Toolkit?
• Silex?
• Phunction?
• K2F?
• Phraw?
• Qcodo?
• Slim?
• Phalcon?
• Roll your own…?
WHY SO MANY?
The million dollar question…
Before we answer that…
Why do other languages seem to have clear leaders?
• Ruby has Rails
• Python has Django
• Groovy has Grails
• C# has MVC
• Java has Spring
Many solutions to the same problem…
usually indicates an underlying issue…
which leads to lots of trade offs
What does that mean for PHP?
PHP is bad at frameworks…
…out of the box
So let’s dig into that a little
• Ruby, Python, Groovy, C#, and Java have
something in common
• They boot up…
– The application gets loaded into RAM
– Runs initializer code
– Makes its database connection(s) with a pool
– Listens for requests and only processes that request
– Can share RAM between requests
– Built for long term garbage collection
PHP…
• Reprocesses everything on every single request
• Configuration
• Route mappings
• Database connections
• Loading all of those framework files
– Devastating to Disk I/O
• Encapsulates and garbage collects each individual
process
So a PHP framework has too…
• Cache…heavily
– And then reload those configuration caches on
every request
• Per request RAM allocation is HEAVY
– It’s not loaded once and then processed
– Framework is loaded every time for every request
A HISTORY LESSON
Don’t worry, we’ll get back to the story
Rails lit the world on fire
• Java’s Struts popularized MVC…but was awful
• Rails made MVC good…
– And EEEEEEVERYBODY copied it as best they could
– CakePHP was a near clone for a while
– Microsoft’s MVC framework…almost carbon copy
– Grails…do I need to explain this?
But why did Rails take off?
• Ruby is great…but it’s not built for the web
• PHP is built for the web
• Ruby is an excellent language for writing Domain Specific Languages (DSLs)
– Think….
• Puppet, Chef, Capistrano, Vagrant
– Rails is a DSL for the web
• It changes Ruby to make it a web language
• That added to its popularity significantly in the Ruby community
– Nearly every Ruby library has a Rails version for premium integration
– Ruby developers are very big on testing because of the language’s flexibility
• good at testing and easy to break
– Ruby developers place a premium on workflow
• That’s a heck of a lot more than just arranging some files and throwing
routing and hooks on top…they built an entire mode of operation
This is important for PHP
PHP is built for the web out of the box
With no framework…
it can rock your face off
So why so many frameworks?
• Well…prior to PHP 5.3
– PHP was terrible for frameworks for all the reasons
previously mentioned
• Also, lack of namespaces made sharing libraries a PAAAAIN
– 5.3 was released in 2010
– CakePHP 1.1 was popular in 2006 because it ran on
PHP 4 and PHP 5 while structurally copying Rails
– The PHP “framework wars” started during a time
when PHP was bad at frameworks…hence the variety,
saturation, and trade offs
• Everybody tried to solve the problem a different way
Prior to 5.3 you needed to…
• Enable APC on the server
– Optimized PHP byte code cached in RAM
– Share RAM between process (under Apache mod_php only)
– In production, set APC to not check for file changes
– This got around the Disk I/O and overhead of reloading all those files
– Also drastically reduced per-request RAM
• With CakePHP we’d go from 12mb to 2mb (also mod_php only)
• Configure a database connection pool within Apache
– OR ensure you were using MySQL because the overhead of new connections is almost
negligible
• Avoid .htaccess files like the plague
– Every framework used them for “pretty urls” instead of having them added to a server config
• Setup a reverse proxy w/ nginx
– Intercept non-application requests prior to Apache processing .htaccess rules
• Use framework specific class loaders to try to load things only when necessary
• Frameworks had to roll almost everything themselves to avoid naming conflicts
with outside libraries
– Extensive “does this work with X?” syndrome
So what changed?
• In 5.3
– Late static bindings
– Namespaces
• In 5.4
– Traits
– Artisan
• Built in Web Server
• CLI
• These allow…
– Lazy loading
– Dependency injection
– Aspect Oriented
Programming (AOP)
– Simpler development
workflow
– Much easier library / package
management
What is PHP good at?
• Scales down OR up better than any other language
– “Boot up” web languages can’t scale down easily
– With PHP, you can fill up a hard drive with code and it will all work
• Other languages, you fill up your RAM and you’re done
• This is why PHP shared hosting is everywhere and dirt cheap
• Encapsulation of each request provides near perfect server stability
– Tell me next time somebody uses “PHP” and “Memory Leak” in a sentence
– If a request dies it can’t crash the server
• In it’s raw form, it can already do almost everything you need
– Example: Built an on-the-fly image processing server for a huge site
– Same functionality previously kept crashing Rails processes
…because memory leaks
– Increased efficiency by 3000% (seriously)
Oh…and it can fly (the scaling up part)
What is PHP bad at?
More on long polling
• PHP is bad at long running process
• Long polling involves many long running connections
– which for PHP means many long running processes…
– which will vary based on the number of your users
So for example:
• Optimal PHP request/response cycle
– Request received
– PHP started
– Libraries loaded/RAM allocated (2-12mb)
– Request processed
– Request ended, garbage collected
– Total time < .5 seconds (hopefully)
• Long polling PHP request/response cycle
– Request received
– PHP started
– Libraries loaded/RAM allocated (2-12mb)
– ………. (30-60 seconds)
– Request ended, garbage collected
– Total time 30-60 seconds
– Your servers RAM will be swallowed with a dramatically lower number of users from
holding open dozens of 12mb connections
– You can make it “work” but in production you’ll have massive scaling issues
from concurrency
• nginx_http_push_module – This is not a php specific solution
– Request received with internal response address
– PHP started
– Libraries loaded/RAM allocated (2-12mb)
– Requested added to queue
– Request ended, garbage collected
– Total time < .5 seconds
– nginx holds the long polled connection instead of php
– Single background process pulls requests off the queue and processes them
– Sends response to the internal response address
– The background process handles responding to the long polling request so you control
how many are running in parallel, not your user traffic
– nginx holds the concurrent connections efficiently (as good or greater concurrency than
Node.js)
Long running processes
• Please don’t use PHP for long
polling…ever
• No really
• All those documents that say PHP
is bad at long polling…don’t take
it as a challenge…they mean it
• But if you must use
nginx_http_push_module
Also…method syntax consistency and
assorted other quirks…
But it’s more than just code
• The business problem:
– How do I find programmers who know this framework?
• Case: Brightball
– I loved CakePHP. It was complex, had a steep learning curve but
was incredibly powerful
– We built a tool around it that would generate a permission
controlled, data linked, interface based solely off of the
database structure
• AKA “The Intersect” (we were big fans of Chuck)
• Really bad for billable hours 
– Hard to find people who knew Cake (or any other specific
framework) despite “popularity” numbers
– With complexity, training and learning curve are bad
This is where Code Igniter took off
• Code Igniter was not as awesome as Cake
(sorry CI people)
– I know one of you wants to argue this point…your opinion is wrong
• But it was a heck of a lot simpler
• Learning curve and training ease led to a huge
following
– And Expression Engine
Not a problem in other languages
• Dominant frameworks lead to common knowledge
bases among developers
• Hard to find a Ruby programmer that doesn’t know
Rails
• That allows continuous evolution because businesses
avoid the training/hiring quandry
• Namespaces allows easy library integration and sharing
between frameworks and for the language as a whole
Then there’s workflow…
• Common frameworks lead to…
– Common testing integrations
– Common library integrations
– Common database flow
– Common team operations
So the answer is…?
If I have to tell you the “right” framework...
then there isn’t a clear choice
WAT!
No!
Not that!
Just kidding 
LET’S TALK ABOUT LARAVEL
This will be fun
First the framework wars
• What about all the “other” frameworks
– All of the existing dominant frameworks have to
maintain a migration path for their user bases
– This makes full reinvention on php >= 5.4…hard
• Laravel does not have this problem
– But it does need to gain widespread adoption
So first up…
Laravel is a Rails clone
And I mean that in a good way
They didn’t just go for file structure
Or callbacks
Or active record
Or middleware
Or migrations
Or testing
Or workflow
Or modularity
They ate the whole…dang…thing
Libraries
Ruby on Rails
• Ruby has Gems
• Rails applications have a
Gemfile
• Bundler installs Gems and
manages dependencies
PHP and Laravel
• PHP has Composer
– And PEAR
– And PECL
• Laravel uses Composer
• Namespaces make this work
Dev Environment
Ruby on Rails
• Ruby has RVM
– Ruby version manager
– “cd” into a project directory and
your ruby version and gemset
changes
• Bundled web server
– From your project directory, your
application runs
– Dozens of projects in different
versions, with different libraries
and different dependencies are
easy
• Command line app access
– Rails console
PHP and Laravel
• Php 5.4 + has Artisan
– Going forward, running multiple
local versions of PHP will be easier
– Also will make tools like Foreman
an option for complex apps
• Laravel has Homestead
– Complete Vagrant based dev
environment
– A framework that takes dev
environments this seriously is huge
– Will only improve thanks to Docker
• Command line app access
– Artisan CLI
Migrations
Ruby on Rails
• Migrations are “the” way
• Necessary for teams
working on the same code
locally
• Eases deployment across
multiple environments
PHP and Laravel
• Migrations are “the” way
• Virtually identical to Rails
migrations
ORM
“Laravel ships with a superb ORM: Eloquent. If
you have used the Ruby on Rails framework, you
will find Eloquent familiar, as it follows the
ActiveRecord ORM style of database
interaction.”
– Laravel documentation
Deployment
Ruby on Rails
• You can always run your
own…
• But Heroku is where Rails
apps begin
• Deployment:
– `git push heroku master`
– Aaaaand that’s it
PHP and Laravel
• You can always run your
own…
• But Laravel Forge makes it
easy to get
 THAT
On Linode, Digital Ocean,
Rackspace or AWS
Other stuff
Ruby on Rails
• Built with testing in mind
• Queuing is standardized
• RESTful
• Excellent localization
• Extremely well documented
• Rack Middleware layer
• Highly modular
• Very clean syntax
Laravel
• Built with testing in mind
• Queuing is standardized
• RESTful
• Excellent localization
• Extremely well documented
• StackPHP Middleware Layer
• Highly modular
• Very clean syntax
What Laravel needs…
• Like any PHP Framework, it needs saturation
• It’s covered all the other bases
– Powerful MVC framework
– Developer workflow
– Full language package management
– Simple, fast deployment options
– Very well documented
– Built for teams (testing + migrations)
– Modular
• Just needs more people using it to solve the “hiring”
case
Thanks!
now go learn Laravel
Credits/Reference
• http://www.techempower.com/benchmarks/#section=data
-r9
• http://laravel.com/
• http://rubyonrails.org/
• http://cakephp.org/
• http://ellislab.com/codeigniter
• https://www.google.com/imghp
• http://rack.github.io/
• http://stackphp.com/
• http://php.net/releases/5_3_0.php
• http://php.net/releases/5_4_0.php
• http://www.php.net//manual/en/book.apc.php
Ad

More Related Content

What's hot (20)

Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)
Martijn Verburg
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Ortus Solutions, Corp
 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in ruby
Huy Do
 
PHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsPHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traits
Graham Weldon
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
Alex Birch
 
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishContent Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Jani Tarvainen
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
sandeepji_choudhary
 
SydPHP March 2012 Meetup
SydPHP March 2012 MeetupSydPHP March 2012 Meetup
SydPHP March 2012 Meetup
Graham Weldon
 
CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011
Graham Weldon
 
Re-imaginging CakePHP
Re-imaginging CakePHPRe-imaginging CakePHP
Re-imaginging CakePHP
Graham Weldon
 
Whats next in templating
Whats next in templatingWhats next in templating
Whats next in templating
Filip Bruun Bech-Larsen
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
 
Ruby and Security
Ruby and SecurityRuby and Security
Ruby and Security
Carl Sampson, CSSLP
 
CPAN Curation
CPAN CurationCPAN Curation
CPAN Curation
neilbowers
 
Week 5
Week 5Week 5
Week 5
A VD
 
Ruby an overall approach
Ruby an overall approachRuby an overall approach
Ruby an overall approach
Felipe Schmitt
 
CakePHP - The Path to 2.0
CakePHP - The Path to 2.0CakePHP - The Path to 2.0
CakePHP - The Path to 2.0
Graham Weldon
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
mithunsasidharan
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the rest
george.james
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 
Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)
Martijn Verburg
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
Ortus Solutions, Corp
 
Making CLI app in ruby
Making CLI app in rubyMaking CLI app in ruby
Making CLI app in ruby
Huy Do
 
PHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traitsPHP 5.4 - Begin your love affair with traits
PHP 5.4 - Begin your love affair with traits
Graham Weldon
 
A tour of Java and the JVM
A tour of Java and the JVMA tour of Java and the JVM
A tour of Java and the JVM
Alex Birch
 
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishContent Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Jani Tarvainen
 
JSR 335 / java 8 - update reference
JSR 335 / java 8 - update referenceJSR 335 / java 8 - update reference
JSR 335 / java 8 - update reference
sandeepji_choudhary
 
SydPHP March 2012 Meetup
SydPHP March 2012 MeetupSydPHP March 2012 Meetup
SydPHP March 2012 Meetup
Graham Weldon
 
CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011
Graham Weldon
 
Re-imaginging CakePHP
Re-imaginging CakePHPRe-imaginging CakePHP
Re-imaginging CakePHP
Graham Weldon
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
Martijn Verburg
 
Week 5
Week 5Week 5
Week 5
A VD
 
Ruby an overall approach
Ruby an overall approachRuby an overall approach
Ruby an overall approach
Felipe Schmitt
 
CakePHP - The Path to 2.0
CakePHP - The Path to 2.0CakePHP - The Path to 2.0
CakePHP - The Path to 2.0
Graham Weldon
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
mithunsasidharan
 
Web Development Environments: Choose the best or go with the rest
Web Development Environments:  Choose the best or go with the restWeb Development Environments:  Choose the best or go with the rest
Web Development Environments: Choose the best or go with the rest
george.james
 
Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®Build software like a bag of marbles, not a castle of LEGO®
Build software like a bag of marbles, not a castle of LEGO®
Hannes Lowette
 

Similar to What's the "right" PHP Framework? (20)

Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UK
Ricard Clau
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
Elizabeth Smith
 
EKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdfEKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdf
Arnaud Bouchez
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
Derek Jacoby
 
Week 5
Week 5Week 5
Week 5
A VD
 
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptxChapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
berihun18
 
QEWD.js: Have your Node.js Cake and Eat It Too
QEWD.js: Have your Node.js Cake and Eat It TooQEWD.js: Have your Node.js Cake and Eat It Too
QEWD.js: Have your Node.js Cake and Eat It Too
Rob Tweed
 
ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
David Bergunder
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
Kirk Madera
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
MaryamAnwar10
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
ADARSH BHATT
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
Barry Jones
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
 
MPI, Erlang and the web
MPI, Erlang and the webMPI, Erlang and the web
MPI, Erlang and the web
Lenz Gschwendtner
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
SingleStore
 
PHP vs JavaScript
PHP vs JavaScriptPHP vs JavaScript
PHP vs JavaScript
MaryamAnwar10
 
Infrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous DeliveryInfrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous Delivery
Carlo Bonamico
 
Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UK
Ricard Clau
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
Elizabeth Smith
 
EKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdfEKON27-FrameworksExpressiveness.pdf
EKON27-FrameworksExpressiveness.pdf
Arnaud Bouchez
 
Untangling spring week1
Untangling spring week1Untangling spring week1
Untangling spring week1
Derek Jacoby
 
Week 5
Week 5Week 5
Week 5
A VD
 
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptxChapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
Chapter onehsfhjfgjhdjhdhfsGfhghsgasg (2).pptx
berihun18
 
QEWD.js: Have your Node.js Cake and Eat It Too
QEWD.js: Have your Node.js Cake and Eat It TooQEWD.js: Have your Node.js Cake and Eat It Too
QEWD.js: Have your Node.js Cake and Eat It Too
Rob Tweed
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
Kirk Madera
 
Top 10 php frameworks in 2021
Top 10 php frameworks in 2021Top 10 php frameworks in 2021
Top 10 php frameworks in 2021
MaryamAnwar10
 
Learn PHP Lacture1
Learn PHP Lacture1Learn PHP Lacture1
Learn PHP Lacture1
ADARSH BHATT
 
Repeating History...On Purpose...with Elixir
Repeating History...On Purpose...with ElixirRepeating History...On Purpose...with Elixir
Repeating History...On Purpose...with Elixir
Barry Jones
 
The Characteristics of a Successful SPA
The Characteristics of a Successful SPAThe Characteristics of a Successful SPA
The Characteristics of a Successful SPA
Gil Fink
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Php training in bhubaneswar
Php training in bhubaneswar Php training in bhubaneswar
Php training in bhubaneswar
litbbsr
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
SingleStore
 
Infrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous DeliveryInfrastructure as Data with Ansible for easier Continuous Delivery
Infrastructure as Data with Ansible for easier Continuous Delivery
Carlo Bonamico
 
Ad

More from Barry Jones (11)

Day 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application ArchitectureDay 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application Architecture
Barry Jones
 
Day 8 - jRuby
Day 8 - jRubyDay 8 - jRuby
Day 8 - jRuby
Barry Jones
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
Barry Jones
 
Day 6 - PostGIS
Day 6 - PostGISDay 6 - PostGIS
Day 6 - PostGIS
Barry Jones
 
Day 4 - Models
Day 4 - ModelsDay 4 - Models
Day 4 - Models
Barry Jones
 
Day 2 - Intro to Rails
Day 2 - Intro to RailsDay 2 - Intro to Rails
Day 2 - Intro to Rails
Barry Jones
 
Day 1 - Intro to Ruby
Day 1 - Intro to RubyDay 1 - Intro to Ruby
Day 1 - Intro to Ruby
Barry Jones
 
Protecting Users from Fraud
Protecting Users from FraudProtecting Users from Fraud
Protecting Users from Fraud
Barry Jones
 
AWS re:Invent 2013 Recap
AWS re:Invent 2013 RecapAWS re:Invent 2013 Recap
AWS re:Invent 2013 Recap
Barry Jones
 
Pair Programming - the lightning talk
Pair Programming - the lightning talkPair Programming - the lightning talk
Pair Programming - the lightning talk
Barry Jones
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
Barry Jones
 
Day 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application ArchitectureDay 9 - PostgreSQL Application Architecture
Day 9 - PostgreSQL Application Architecture
Barry Jones
 
Day 7 - Make it Fast
Day 7 - Make it FastDay 7 - Make it Fast
Day 7 - Make it Fast
Barry Jones
 
Day 2 - Intro to Rails
Day 2 - Intro to RailsDay 2 - Intro to Rails
Day 2 - Intro to Rails
Barry Jones
 
Day 1 - Intro to Ruby
Day 1 - Intro to RubyDay 1 - Intro to Ruby
Day 1 - Intro to Ruby
Barry Jones
 
Protecting Users from Fraud
Protecting Users from FraudProtecting Users from Fraud
Protecting Users from Fraud
Barry Jones
 
AWS re:Invent 2013 Recap
AWS re:Invent 2013 RecapAWS re:Invent 2013 Recap
AWS re:Invent 2013 Recap
Barry Jones
 
Pair Programming - the lightning talk
Pair Programming - the lightning talkPair Programming - the lightning talk
Pair Programming - the lightning talk
Barry Jones
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
Barry Jones
 
Ad

Recently uploaded (19)

Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 
Determining Glass is mechanical textile
Determining  Glass is mechanical textileDetermining  Glass is mechanical textile
Determining Glass is mechanical textile
Azizul Hakim
 
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation TemplateSmart Mobile App Pitch Deck丨AI Travel App Presentation Template
Smart Mobile App Pitch Deck丨AI Travel App Presentation Template
yojeari421237
 
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC -Policy Development Process, presented at Local APIGA Taiwan 2025
APNIC
 
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHostingTop Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
Top Vancouver Green Business Ideas for 2025 Powered by 4GoodHosting
steve198109
 
highend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptxhighend-srxseries-services-gateways-customer-presentation.pptx
highend-srxseries-services-gateways-customer-presentation.pptx
elhadjcheikhdiop
 
project_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptxproject_based_laaaaaaaaaaearning,kelompok 10.pptx
project_based_laaaaaaaaaaearning,kelompok 10.pptx
redzuriel13
 
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry SweetserAPNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC Update, presented at NZNOG 2025 by Terry Sweetser
APNIC
 
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...Mobile database for your company telemarketing or sms marketing campaigns. Fr...
Mobile database for your company telemarketing or sms marketing campaigns. Fr...
DataProvider1
 
IT Services Workflow From Request to Resolution
IT Services Workflow From Request to ResolutionIT Services Workflow From Request to Resolution
IT Services Workflow From Request to Resolution
mzmziiskd
 
DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)DNS Resolvers and Nameservers (in New Zealand)
DNS Resolvers and Nameservers (in New Zealand)
APNIC
 
White and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptxWhite and Red Clean Car Business Pitch Presentation.pptx
White and Red Clean Car Business Pitch Presentation.pptx
canumatown
 
(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security(Hosting PHising Sites) for Cryptography and network security
(Hosting PHising Sites) for Cryptography and network security
aluacharya169
 
Understanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep WebUnderstanding the Tor Network and Exploring the Deep Web
Understanding the Tor Network and Exploring the Deep Web
nabilajabin35
 
Perguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolhaPerguntas dos animais - Slides ilustrados de múltipla escolha
Perguntas dos animais - Slides ilustrados de múltipla escolha
socaslev
 
OSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description fOSI TCP IP Protocol Layers description f
OSI TCP IP Protocol Layers description f
cbr49917
 
Best web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you businessBest web hosting Vancouver 2025 for you business
Best web hosting Vancouver 2025 for you business
steve198109
 
Computers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers NetworksComputers Networks Computers Networks Computers Networks
Computers Networks Computers Networks Computers Networks
Tito208863
 
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 SupportReliable Vancouver Web Hosting with Local Servers & 24/7 Support
Reliable Vancouver Web Hosting with Local Servers & 24/7 Support
steve198109
 
5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx5-Proses-proses Akuisisi Citra Digital.pptx
5-Proses-proses Akuisisi Citra Digital.pptx
andani26
 

What's the "right" PHP Framework?

  • 1. What’s the “right” PHP Framework? Barry Jones
  • 2. Who am I? • Barry Jones • Java/Groovy/PHP/Perl developer since ’98 • Ruby on Rails developer mostly since 2012 • Formerly ran Brightball, Inc here in Greenville – Contract programming business from 2008-2012 – 99% CakePHP… – Built our platform “The Intersect” on top of Cake • Software Architect with ACS Technologies, Inc
  • 3. SO WHICH ONE IS IT? The people need to know….
  • 4. Is it… • Zend Framework? • CakePHP? • Symfony? • FuelPHP? • Code Igniter? • Lithium? • Laravel? • Solar? OR…. • Kohana? • Yii? • Prado? • Akelos? • PHP Fat-Free? • Agile Toolkit? • Silex? • Phunction? • K2F? • Phraw? • Qcodo? • Slim? • Phalcon? • Roll your own…?
  • 5. WHY SO MANY? The million dollar question…
  • 6. Before we answer that… Why do other languages seem to have clear leaders? • Ruby has Rails • Python has Django • Groovy has Grails • C# has MVC • Java has Spring
  • 7. Many solutions to the same problem… usually indicates an underlying issue… which leads to lots of trade offs
  • 8. What does that mean for PHP? PHP is bad at frameworks… …out of the box
  • 9. So let’s dig into that a little • Ruby, Python, Groovy, C#, and Java have something in common • They boot up… – The application gets loaded into RAM – Runs initializer code – Makes its database connection(s) with a pool – Listens for requests and only processes that request – Can share RAM between requests – Built for long term garbage collection
  • 10. PHP… • Reprocesses everything on every single request • Configuration • Route mappings • Database connections • Loading all of those framework files – Devastating to Disk I/O • Encapsulates and garbage collects each individual process
  • 11. So a PHP framework has too… • Cache…heavily – And then reload those configuration caches on every request • Per request RAM allocation is HEAVY – It’s not loaded once and then processed – Framework is loaded every time for every request
  • 12. A HISTORY LESSON Don’t worry, we’ll get back to the story
  • 13. Rails lit the world on fire • Java’s Struts popularized MVC…but was awful • Rails made MVC good… – And EEEEEEVERYBODY copied it as best they could – CakePHP was a near clone for a while – Microsoft’s MVC framework…almost carbon copy – Grails…do I need to explain this?
  • 14. But why did Rails take off? • Ruby is great…but it’s not built for the web • PHP is built for the web • Ruby is an excellent language for writing Domain Specific Languages (DSLs) – Think…. • Puppet, Chef, Capistrano, Vagrant – Rails is a DSL for the web • It changes Ruby to make it a web language • That added to its popularity significantly in the Ruby community – Nearly every Ruby library has a Rails version for premium integration – Ruby developers are very big on testing because of the language’s flexibility • good at testing and easy to break – Ruby developers place a premium on workflow • That’s a heck of a lot more than just arranging some files and throwing routing and hooks on top…they built an entire mode of operation
  • 15. This is important for PHP PHP is built for the web out of the box With no framework… it can rock your face off
  • 16. So why so many frameworks? • Well…prior to PHP 5.3 – PHP was terrible for frameworks for all the reasons previously mentioned • Also, lack of namespaces made sharing libraries a PAAAAIN – 5.3 was released in 2010 – CakePHP 1.1 was popular in 2006 because it ran on PHP 4 and PHP 5 while structurally copying Rails – The PHP “framework wars” started during a time when PHP was bad at frameworks…hence the variety, saturation, and trade offs • Everybody tried to solve the problem a different way
  • 17. Prior to 5.3 you needed to… • Enable APC on the server – Optimized PHP byte code cached in RAM – Share RAM between process (under Apache mod_php only) – In production, set APC to not check for file changes – This got around the Disk I/O and overhead of reloading all those files – Also drastically reduced per-request RAM • With CakePHP we’d go from 12mb to 2mb (also mod_php only) • Configure a database connection pool within Apache – OR ensure you were using MySQL because the overhead of new connections is almost negligible • Avoid .htaccess files like the plague – Every framework used them for “pretty urls” instead of having them added to a server config • Setup a reverse proxy w/ nginx – Intercept non-application requests prior to Apache processing .htaccess rules • Use framework specific class loaders to try to load things only when necessary • Frameworks had to roll almost everything themselves to avoid naming conflicts with outside libraries – Extensive “does this work with X?” syndrome
  • 18. So what changed? • In 5.3 – Late static bindings – Namespaces • In 5.4 – Traits – Artisan • Built in Web Server • CLI • These allow… – Lazy loading – Dependency injection – Aspect Oriented Programming (AOP) – Simpler development workflow – Much easier library / package management
  • 19. What is PHP good at? • Scales down OR up better than any other language – “Boot up” web languages can’t scale down easily – With PHP, you can fill up a hard drive with code and it will all work • Other languages, you fill up your RAM and you’re done • This is why PHP shared hosting is everywhere and dirt cheap • Encapsulation of each request provides near perfect server stability – Tell me next time somebody uses “PHP” and “Memory Leak” in a sentence – If a request dies it can’t crash the server • In it’s raw form, it can already do almost everything you need – Example: Built an on-the-fly image processing server for a huge site – Same functionality previously kept crashing Rails processes …because memory leaks – Increased efficiency by 3000% (seriously)
  • 20. Oh…and it can fly (the scaling up part)
  • 21. What is PHP bad at? More on long polling • PHP is bad at long running process • Long polling involves many long running connections – which for PHP means many long running processes… – which will vary based on the number of your users So for example: • Optimal PHP request/response cycle – Request received – PHP started – Libraries loaded/RAM allocated (2-12mb) – Request processed – Request ended, garbage collected – Total time < .5 seconds (hopefully) • Long polling PHP request/response cycle – Request received – PHP started – Libraries loaded/RAM allocated (2-12mb) – ………. (30-60 seconds) – Request ended, garbage collected – Total time 30-60 seconds – Your servers RAM will be swallowed with a dramatically lower number of users from holding open dozens of 12mb connections – You can make it “work” but in production you’ll have massive scaling issues from concurrency • nginx_http_push_module – This is not a php specific solution – Request received with internal response address – PHP started – Libraries loaded/RAM allocated (2-12mb) – Requested added to queue – Request ended, garbage collected – Total time < .5 seconds – nginx holds the long polled connection instead of php – Single background process pulls requests off the queue and processes them – Sends response to the internal response address – The background process handles responding to the long polling request so you control how many are running in parallel, not your user traffic – nginx holds the concurrent connections efficiently (as good or greater concurrency than Node.js) Long running processes • Please don’t use PHP for long polling…ever • No really • All those documents that say PHP is bad at long polling…don’t take it as a challenge…they mean it • But if you must use nginx_http_push_module Also…method syntax consistency and assorted other quirks…
  • 22. But it’s more than just code • The business problem: – How do I find programmers who know this framework? • Case: Brightball – I loved CakePHP. It was complex, had a steep learning curve but was incredibly powerful – We built a tool around it that would generate a permission controlled, data linked, interface based solely off of the database structure • AKA “The Intersect” (we were big fans of Chuck) • Really bad for billable hours  – Hard to find people who knew Cake (or any other specific framework) despite “popularity” numbers – With complexity, training and learning curve are bad
  • 23. This is where Code Igniter took off • Code Igniter was not as awesome as Cake (sorry CI people) – I know one of you wants to argue this point…your opinion is wrong • But it was a heck of a lot simpler • Learning curve and training ease led to a huge following – And Expression Engine
  • 24. Not a problem in other languages • Dominant frameworks lead to common knowledge bases among developers • Hard to find a Ruby programmer that doesn’t know Rails • That allows continuous evolution because businesses avoid the training/hiring quandry • Namespaces allows easy library integration and sharing between frameworks and for the language as a whole
  • 25. Then there’s workflow… • Common frameworks lead to… – Common testing integrations – Common library integrations – Common database flow – Common team operations
  • 26. So the answer is…? If I have to tell you the “right” framework... then there isn’t a clear choice
  • 27. WAT!
  • 30. LET’S TALK ABOUT LARAVEL This will be fun
  • 31. First the framework wars • What about all the “other” frameworks – All of the existing dominant frameworks have to maintain a migration path for their user bases – This makes full reinvention on php >= 5.4…hard • Laravel does not have this problem – But it does need to gain widespread adoption
  • 32. So first up… Laravel is a Rails clone And I mean that in a good way They didn’t just go for file structure Or callbacks Or active record Or middleware Or migrations Or testing Or workflow Or modularity They ate the whole…dang…thing
  • 33. Libraries Ruby on Rails • Ruby has Gems • Rails applications have a Gemfile • Bundler installs Gems and manages dependencies PHP and Laravel • PHP has Composer – And PEAR – And PECL • Laravel uses Composer • Namespaces make this work
  • 34. Dev Environment Ruby on Rails • Ruby has RVM – Ruby version manager – “cd” into a project directory and your ruby version and gemset changes • Bundled web server – From your project directory, your application runs – Dozens of projects in different versions, with different libraries and different dependencies are easy • Command line app access – Rails console PHP and Laravel • Php 5.4 + has Artisan – Going forward, running multiple local versions of PHP will be easier – Also will make tools like Foreman an option for complex apps • Laravel has Homestead – Complete Vagrant based dev environment – A framework that takes dev environments this seriously is huge – Will only improve thanks to Docker • Command line app access – Artisan CLI
  • 35. Migrations Ruby on Rails • Migrations are “the” way • Necessary for teams working on the same code locally • Eases deployment across multiple environments PHP and Laravel • Migrations are “the” way • Virtually identical to Rails migrations
  • 36. ORM “Laravel ships with a superb ORM: Eloquent. If you have used the Ruby on Rails framework, you will find Eloquent familiar, as it follows the ActiveRecord ORM style of database interaction.” – Laravel documentation
  • 37. Deployment Ruby on Rails • You can always run your own… • But Heroku is where Rails apps begin • Deployment: – `git push heroku master` – Aaaaand that’s it PHP and Laravel • You can always run your own… • But Laravel Forge makes it easy to get  THAT On Linode, Digital Ocean, Rackspace or AWS
  • 38. Other stuff Ruby on Rails • Built with testing in mind • Queuing is standardized • RESTful • Excellent localization • Extremely well documented • Rack Middleware layer • Highly modular • Very clean syntax Laravel • Built with testing in mind • Queuing is standardized • RESTful • Excellent localization • Extremely well documented • StackPHP Middleware Layer • Highly modular • Very clean syntax
  • 39. What Laravel needs… • Like any PHP Framework, it needs saturation • It’s covered all the other bases – Powerful MVC framework – Developer workflow – Full language package management – Simple, fast deployment options – Very well documented – Built for teams (testing + migrations) – Modular • Just needs more people using it to solve the “hiring” case
  • 41. Credits/Reference • http://www.techempower.com/benchmarks/#section=data -r9 • http://laravel.com/ • http://rubyonrails.org/ • http://cakephp.org/ • http://ellislab.com/codeigniter • https://www.google.com/imghp • http://rack.github.io/ • http://stackphp.com/ • http://php.net/releases/5_3_0.php • http://php.net/releases/5_4_0.php • http://www.php.net//manual/en/book.apc.php