php in the cloud - php barcelona
DESCRIPTION
TRANSCRIPT
![Page 2: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/2.jpg)
WHO IS THIS GUY?
Juozas Kaziukėnas, Lithuanian
You can call me Joe
3 years in Edinburgh, UK
CEO of Web Species Ltd
Occasional open source developer
Conferences speaker
More info in http://juokaz.com
Tweet me @juokaz
![Page 3: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/3.jpg)
CLOUD
![Page 4: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/4.jpg)
SOMEONE’S IMAGINATION?
![Page 5: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/5.jpg)
CAME TO PHP IN 2010*
![Page 6: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/6.jpg)
![Page 7: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/7.jpg)
WHAT CLOUD MEANS
“A model for consumption & delivery on the
internet where flexibility is essential & can be
guaranteed through abstraction” – Thijs Feryn
![Page 8: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/8.jpg)
ENOUGH OF THIS *CLOUD*
![Page 9: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/9.jpg)
IF YOU TAKE ONE THING
OUT OF THIS
PRESENTATION
WHAT WOULD THAT BE?
![Page 10: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/10.jpg)
CLOUD DRINKING GAME
Every time
someone says
“cloud”, take a
drink
![Page 11: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/11.jpg)
LAYERS
IaaS
PaaS
SaaS
![Page 12: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/12.jpg)
Multiple apps per instance
Freedom to configure
Unmanaged
Learning steps
Hybrid cloud
IAAS VS PAAS
One app per instance
Pre-configured system
Managed
Out of the box
Super cool
![Page 13: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/13.jpg)
WHY WOULD I WANT
THAT?
![Page 14: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/14.jpg)
YOU WANT THIS BECAUSE
Abstraction
Flexibility
Agile
Scale: vertical or horizontal
It sells nowadays
![Page 15: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/15.jpg)
ZYNGA CASE
![Page 16: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/16.jpg)
CLOUD READY APP
Any app deployed to the cloud – not really what cloud is for
Cloud can be just a host, but it’s more
If you don’t need elasticity…
Use surrounding services
• Storage
• Database
• Queues
• Etc.
![Page 17: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/17.jpg)
CLOUDS
Amazon EC2
Microsoft Windows Azure
Rackspace
Gazillion more
![Page 18: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/18.jpg)
CLOUDS
Custom setup
Learning curve
Unmanaged cloud
Can take a lot of hoops
![Page 19: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/19.jpg)
SETTING SERVERS UP IS
NOT EASY
YOUR BUSINESS IS TO
CREATE APPS
![Page 20: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/20.jpg)
This talk
is about
PaaS
![Page 21: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/21.jpg)
PHP COMMUNITY MOVING
We decided to create our own clouds
On top of existing platforms
Optimized and made easier for PHP developers
We know how to make PHP work well
Community support
![Page 22: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/22.jpg)
PHP CLOUDS
![Page 23: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/23.jpg)
PHP CLOUDS
Similar approaches
Deploy from Git/SVN or push
Very simple to deploy
Cheap to run
Out of the box support for tools and frameworks
Horizontal scaling
![Page 24: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/24.jpg)
HOW IT WORKS
![Page 25: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/25.jpg)
LET’S DEPLOY
So you want to
deploy to a
cloud…
![Page 26: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/26.jpg)
LET’S DEPLOY
If internet works
Simple PHP app deployed to
• Orchestra
• Azure+
This is so cool
![Page 27: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/27.jpg)
Runs on Windows Azure
Microsoft SQL server
Deploy from GIT or push
Choose PHP version
In development
AZURE+ V S. ORCHESTRA
Runs on Amazon EC2
Mysql, MongoDB etc.
Deploy from GIT
PHP 5.3 (custom)
Stable
![Page 28: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/28.jpg)
HARDCORE DEPLOY ACTION
![Page 29: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/29.jpg)
PRETTY MUCH ANY APP
WILL WORK, UNLESS…
![Page 30: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/30.jpg)
YOUR APP SHOULD BE…
Don’t use local disk/storage
• Sessions
• Files
Don’t expect things to exist
Latency between servers
Shared state
Abstract enough, no direct calls
![Page 31: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/31.jpg)
SHARE NOTHING
Makes horizontal scaling impossible
State stored between server
Application files in network drive
![Page 32: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/32.jpg)
MUCH MORE EASIER
If you use a framework
• Stops you from doing stupid things
Abstract database interactions
• Using ORM
Don’t try to do things with PHP which are not meant to be done
![Page 33: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/33.jpg)
LEVERAGE SERVICES
API wrappers and SDK available in PHP
Store files in CDN
Use cloud databases
Manage the service
Automate
![Page 34: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/34.jpg)
DEPLOY
I like to push code
Deploy branch in a repository is fine too
Use automated scripts
• Preconfigure apps
• You don’t get access to PaaS servers
Forget about FTP
![Page 35: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/35.jpg)
![Page 36: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/36.jpg)
UNHAPPY CLOUD
![Page 37: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/37.jpg)
CAN BE DOWN
“A lightning strike in Dublin, Ireland knocked
Amazon's European cloud services offline Sunday
and some customers were expected to be down for
up to two days” – Information Week
![Page 38: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/38.jpg)
CAN BE DOWN
“Sites across the U.S. went offline for up to 12 hours
yesterday as Amazon's northern Virginia data centre
was hit by a series of outages” – Daily Mail
![Page 39: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/39.jpg)
CAN BE DOWN
“During a routine operating system upgrade on
Friday (March 13th), the deployment service within
Windows Azure began to slow down due to
networking issues. This caused a large number of
servers to time out and fail” – MSDN blog
![Page 40: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/40.jpg)
UNHAPPY CLOUD
It’s not magically reliable
It can be less reliable than on-premises server
• Need multiple instances
• Load balancer
Deploy across data centers
Hybrid cloud, again
![Page 41: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/41.jpg)
CONCLUSION
Make a choice IaaS vs PaaS
Try out PaaS just for fun (doesn’t cost anything)
Write your apps correctly
Scale
![Page 42: PHP in the Cloud - PHP Barcelona](https://reader033.vdocuments.us/reader033/viewer/2022051816/546b8d9eb4af9f932c8b4c7a/html5/thumbnails/42.jpg)
THANK YOU!
Keep in touch
http://juokaz.com
twitter: @juokaz
Rate at http://joind.in/4317