php in the cloud

29
PHP in the Cloud The Future of the Glue of the Internet

Upload: acquia

Post on 20-May-2015

2.042 views

Category:

Documents


0 download

DESCRIPTION

Andrew Kenney's presentation at Boston Startup School.

TRANSCRIPT

Page 1: PHP in the Cloud

PHP in the Cloud The Future of the Glue of the Internet

Page 2: PHP in the Cloud

About Me

•  Andrew Kenney •  VP, Cloud Engineering @ Acquia •  Previously President/CTO @ ONEsite

@syrneus - [email protected] - [email protected] purefire.com - linkedin.com/akenney - github.com/syrneus

Page 3: PHP in the Cloud

Glue of the Internet

•  “PHP is glue. It is the glue used to build cool web applications by sticking dozens of 3rd-party libraries together and making it all appear as one coherent entity…” ~PHP.net

Page 4: PHP in the Cloud

PHP in a Nutshell

•  “I don't know how to stop it, there was never any intent to write a programming language” ~ Rasmus Lerdorf, creator of PHP

Page 5: PHP in the Cloud

How did PHP get so big?

•  PHP replaced Perl as the lingua franca of the web

•  PHP.net had great examples and comments

•  Google did not exist •  StackOverflow did not exist

Page 6: PHP in the Cloud

PHP’s History

•  1995 – First Release •  1998 – PHP 3 •  2000 – PHP 4 / Zend Engine I •  2004 – PHP 5 / Zend Engine II •  2009 – PHP 5.3 •  PHP 6 - ???

Page 7: PHP in the Cloud

PHP has a lot of competition…

Top Languages on GitHub

Page 8: PHP in the Cloud

Why use PHP now?

•  Powers the majority of the known web •  Installed everywhere •  Proven scalability •  Large developer community •  Great frameworks

Page 9: PHP in the Cloud

Who Uses PHP?

•  Facebook •  Wikipedia •  Yahoo / Flickr •  White House •  WordPress.com •  Tumblr •  Most large Internet forums •  etc.

Page 10: PHP in the Cloud

Who uses PHP? Acquia!

•  Thousands of PHP servers on Amazon Cloud

•  Billions of monthly pageviews •  Tens of thousands of Drupal sites •  Hosting some of the largest

Drupal sites in the world

Page 11: PHP in the Cloud

PHP CMS Projects

•  Popular CMSes – Drupal – Joomla – WordPress

•  Easier than ever to build a site •  Drupal 8 is going to be amazing…

Page 12: PHP in the Cloud

PHP Frameworks

•  Zend Framework (ZF2) •  Symfony •  FuelPHP / Yii / CodeIgniter / CakePHP •  You’re not a real PHP programmer until

you’ve created your own framework

Page 13: PHP in the Cloud

PHP Stack •  PHP - PHP 5.3+

– Memcache – use it (or use Redis) – APC

•  Web Server – Apache / Nginx / etc.

•  Database – MySQL / Postgres / etc.

•  Operating System – Ubuntu / Red Hat / etc.

Page 14: PHP in the Cloud

PHP in the Cloud

•  It is easy to run a PHP site in the cloud •  It is HARD to run a PHP site in the cloud

with… – High availability – High scalability – High security

Page 15: PHP in the Cloud

PHP Cloud Hosting

•  IaaS – Amazon Web Services – Rackspace Cloud

•  PaaS – PaaS: PHPfog / AppFog / PagodaBox /

Heroku – Drupal Cloud: Acquia Cloud / Pantheon

•  Traditional Hosting – Linode / Rackspace / etc.

Page 16: PHP in the Cloud

Setting up simple LAMP stack

Page 17: PHP in the Cloud

Complicated Cloud LAMP Stack

Site BSites C & D

Availability Zone B

WEB

Availability Zone A

FSDB

MySQL

User FilesGlusterFS

BALVarnish

nginx

WEB

UserFiles

APACHE

Memcache

FSDB

MySQL

User FilesGlusterFS

BALVarnish

nginx

APACHE

Memcache

Drupalvia

Git/SVN

UserFiles

Drupalvia

Git/SVN

Site ASite B

Sites C/D

Site A

MultiregionReplication

Availability Zone B

WEB

Availability Zone A

FSDB

MySQL

User FilesGlusterFS

BALVarnish

nginx

WEB

UserFiles

APACHE

Memcache

FSDB

MySQL

User FilesGlusterFS

BALVarnish

nginx

APACHE

Memcache

Drupalvia

Git/SVN

UserFiles

Drupalvia

Git/SVN

Site A Site A

Acquia Confidential

Page 18: PHP in the Cloud

Use a PaaS for your Startup PagodaBox

Acquia Cloud

AppFog

Page 19: PHP in the Cloud

PagodaBox Symfony Demo

Create a free account on www.pagodabox.com Download simple site at github.com/syrneus/phpinthecloud

Page 20: PHP in the Cloud

PagodaBox Symfony Demo

Name your new application and launch it

Page 21: PHP in the Cloud

PagodaBox Symfony Demo

Setup your SSH keys so you can easily git push changes

Page 22: PHP in the Cloud

PagodaBox Symfony Demo

Navigate to your code on the filesystem and push your website live!

Page 23: PHP in the Cloud

PagodaBox Symfony Demo

Page 24: PHP in the Cloud

PagodaBox Symfony Demo

Page 25: PHP in the Cloud

Drawception – Symfony at Scale •  Everything available as an API •  Twig template engine powered

HTML / mobile / Facebook views

•  Doctrine ORM •  Hosted on PagodaBox

Page 26: PHP in the Cloud

PHP – Lessons Learned

•  Use a framework •  Don’t over engineer scalability •  Use an ORM •  Use UTC server time •  Use a template language (even if it is PHP) •  Plan for internationalization from the beginning •  Use UTF-8 for your Databases •  Version control APIs

Page 27: PHP in the Cloud

Why use PHP for a Startup?

•  Trusted by some of the largest web companies in the world

•  Amazing pool of developer talent •  PHP will not be your bottleneck in

scalability •  Don’t reinvent the wheel. Also use PHP/

Drupal for elements of your startup like the website/blog/community/etc.

Page 28: PHP in the Cloud

Acquia - PHP @ Scale

Page 29: PHP in the Cloud

Questions?

•  Tweet Me: @syrneus •  E-mail Me: [email protected]

@syrneus - [email protected] - [email protected] purefire.com - linkedin.com/akenney - github.com/syrneus

Ask me about Acquia!