This talk is the companion talk to the 'PHP Development in the Cloud' book I wrote with Vito Chin. It's an introduction into cloud computing for PHP developers. Delivered on may 25 at php|tek in Chicago.
13. Clouds According to NIST
“Cloud computing is a model for enabling convenient, on-demand
network access to a shared pool of configurable computing
resources that can be rapidly provisioned and released with
minimal management effort or service provider interaction.
This cloud model promotes availability and is composed of five
essential characteristics, three service models, and four
deployment models.”
National Institute of Standards and Technology
http://csrc.nist.gov/groups/SNS/cloud-computing/
7
Wednesday, May 25, 2011
14. NIST: Five Characteristics
Things that are considered cloud:
‣ On-demand, self-service
‣ Broad network access
‣ Resource pooling
‣ Rapid elasticity
‣ Measured service
8
Wednesday, May 25, 2011
15. NIST: Three Service Models
Cloud applications are:
‣ Software as a Service
‣ Platform as a Service
‣ Infrastructure as a Service
9
Wednesday, May 25, 2011
16. NIST: Four Deployment Models
‣ Private cloud
‣ Community cloud
‣ Public cloud
‣ Hybrid cloud
10
Wednesday, May 25, 2011
18. Application Layers
Standard layers in a typical application:
Application
System Software
Storage
Operating System
Hardware
Network
12
Wednesday, May 25, 2011
19. Infrastructure as a Service
Parts of the infrastructure offered as service to your app:
Application
System Software
Storage
Operating System
Hardware
Network
13
Wednesday, May 25, 2011
20. Infrastructure as a Service
‣ Advantages:
• Easily scalable
• Move from capital expense to operational expense
• Metered use
• Don’t worry about hardware
14
Wednesday, May 25, 2011
21. Example: The Rackspace Cloud
‣ The RackspaceCloud is what used to be called Mosso
‣ Powerful API for managing your cloud
‣ Easy access in PHP through Aleksey Korzun’s PHP API:
• http://github.com/AlekseyKorzun/php-cloudservers
‣ Concepts
• Images (various operating systems)
• Flavors (configuration: mem, cpu, disk)
15
Wednesday, May 25, 2011
24. IaaS Architecture
Prepare your app to run on IaaS
18
Wednesday, May 25, 2011
25. Horizontal Scalability
‣ If you run your app on multiple servers today, would it work?
‣ Typical problem areas:
• Sessions
• Files
19
Wednesday, May 25, 2011
26. Horizontal Scalability
‣ Danga - http://www.danga.com/
• People behind LiveJournal / SixApart
• Creators of tools to help make software horizontally scalable
• Memcache - distributed caching, session clustering
‣ http://github.com/andreiz/php-memcached
• MogileFS - distributed file storage
‣ http://projects.usrportage.de/index.fcgi/php-mogilefs
• Gearman - distributed parallel job processing / message queue
‣ http://pecl.php.net/package/gearman/
20
Wednesday, May 25, 2011
32. Abstraction
‣ Con:
• Common denominator functionality
24
Wednesday, May 25, 2011
33. Abstraction
‣ Con:
• Common denominator functionality
• Adds some overhead
24
Wednesday, May 25, 2011
34. Abstraction
‣ Con:
• Common denominator functionality
• Adds some overhead
‣ Pro:
• Reduce vendor lock-in
24
Wednesday, May 25, 2011
35. Abstraction
‣ Con:
• Common denominator functionality
• Adds some overhead
‣ Pro:
• Reduce vendor lock-in
• Save development time
24
Wednesday, May 25, 2011
36. Abstraction
‣ Con:
• Common denominator functionality
• Adds some overhead
‣ Pro:
• Reduce vendor lock-in
• Save development time
• No need to learn different APIs
24
Wednesday, May 25, 2011
37. Abstraction
‣ Con:
• Common denominator functionality
• Adds some overhead
‣ Pro:
• Reduce vendor lock-in
• Save development time
• No need to learn different APIs
• Promotes competition between providers
24
Wednesday, May 25, 2011
38. Abstraction
‣ Zend’s SimpleCloud
• http://simplecloud.org
• Good attempt at generic cloud abstraction
25
Wednesday, May 25, 2011
40. Platform as a Service
Complete platform offered as a service:
Application
System Software
Storage
Operating System
Hardware
Network
27
Wednesday, May 25, 2011
42. Rackspace’s TrueHybrid
‣ Platform selects the best operating system for your site
‣ Magically blends Windows and Linux, ASP.NET and PHP
29
Wednesday, May 25, 2011
44. Other Platforms for PHP
‣ PHPFog
• http://phpfog.com
‣ Orchestra.io
30
Wednesday, May 25, 2011
45. Other Platforms for PHP
‣ PHPFog
• http://phpfog.com
‣ Orchestra.io
• http://orchestra.io
‣ Both are PaaS cloud platforms for PHP apps
30
Wednesday, May 25, 2011
46. Other Platforms for PHP
‣ PHPFog
• http://phpfog.com
‣ Orchestra.io
• http://orchestra.io
‣ Both are PaaS cloud platforms for PHP apps
• Relatively young, look very promising
30
Wednesday, May 25, 2011
47. Other Platforms for PHP
‣ PHPFog
• http://phpfog.com
‣ Orchestra.io
• http://orchestra.io
‣ Both are PaaS cloud platforms for PHP apps
• Relatively young, look very promising
‣ Google AppEngine
30
Wednesday, May 25, 2011
48. Other Platforms for PHP
‣ PHPFog
• http://phpfog.com
‣ Orchestra.io
• http://orchestra.io
‣ Both are PaaS cloud platforms for PHP apps
• Relatively young, look very promising
‣ Google AppEngine
• http://code.google.com/appengine/
30
Wednesday, May 25, 2011
49. Other Platforms for PHP
‣ PHPFog
• http://phpfog.com
‣ Orchestra.io
• http://orchestra.io
‣ Both are PaaS cloud platforms for PHP apps
• Relatively young, look very promising
‣ Google AppEngine
• http://code.google.com/appengine/
• Python/Java only, but PHP support through Quercus
30
Wednesday, May 25, 2011
53. Software as a Service
‣ Complete applications or application components
33
Wednesday, May 25, 2011
54. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
33
Wednesday, May 25, 2011
55. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
33
Wednesday, May 25, 2011
56. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
• Gmail
33
Wednesday, May 25, 2011
57. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
• Gmail
• Google Apps (office apps, calendar, email)
33
Wednesday, May 25, 2011
58. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
• Gmail
• Google Apps (office apps, calendar, email)
• Salesforce for CRM
33
Wednesday, May 25, 2011
59. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
• Gmail
• Google Apps (office apps, calendar, email)
• Salesforce for CRM
‣ Often built on IaaS
33
Wednesday, May 25, 2011
60. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
• Gmail
• Google Apps (office apps, calendar, email)
• Salesforce for CRM
‣ Often built on IaaS
• Dropbox file sharing (makes use of Amazon S3 for storage)
33
Wednesday, May 25, 2011
61. Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
• Gmail
• Google Apps (office apps, calendar, email)
• Salesforce for CRM
‣ Often built on IaaS
• Dropbox file sharing (makes use of Amazon S3 for storage)
• Jungledisk backups (same)
33
Wednesday, May 25, 2011
62. Example: Salesforce
‣ Gives access to all your data in Salesforce using SOAP
‣ PHP library available
‣ Documentation abundant
• http://developer.force.com/
‣ Salesforce was SaaS way before term ‘cloud’ was coined
‣ Most developer friendly SaaS
• Documentation
• Sandbox functionality (paid)
34
Wednesday, May 25, 2011
63. Example: Salesforce
Source adapted from tutorial at http://www.mikesimonds.com
35
Wednesday, May 25, 2011
69. General SaaS suggestions
‣ Want to work with X from PHP?
• Google ‘X php api’ or ‘X php tutorial’
37
Wednesday, May 25, 2011
70. General SaaS suggestions
‣ Want to work with X from PHP?
• Google ‘X php api’ or ‘X php tutorial’
• You’re almost never the first to want to work with it
37
Wednesday, May 25, 2011
71. General SaaS suggestions
‣ Want to work with X from PHP?
• Google ‘X php api’ or ‘X php tutorial’
• You’re almost never the first to want to work with it
37
Wednesday, May 25, 2011
72. General SaaS suggestions
‣ Want to work with X from PHP?
• Google ‘X php api’ or ‘X php tutorial’
• You’re almost never the first to want to work with it
‣ Interesting finding: Cloud apps are easier to work with than
most desktop/noncloud apps.
37
Wednesday, May 25, 2011
73. The ‘Warcraft Effect’
Clouds are living entities that change when you’re not looking
38
Wednesday, May 25, 2011
76. Creating SaaS
‣ Building a single application for multiple users/customers
40
Wednesday, May 25, 2011
77. Creating SaaS
‣ Building a single application for multiple users/customers
‣ Things to pay attention to:
• Reliability (one customer getting in the way of another)
• Security (competitors seeing each other’s data)
• Deployment
40
Wednesday, May 25, 2011
78. Multi-Tenancy evolution
Source: http://msdn.microsoft.com/en-us/library/aa479069.aspx
41
Wednesday, May 25, 2011
86. Summary
‣ What is the Cloud?
48
Wednesday, May 25, 2011
87. Summary
‣ What is the Cloud?
• The cloud = IaaS + PaaS + SaaS
48
Wednesday, May 25, 2011
88. Summary
‣ What is the Cloud?
• The cloud = IaaS + PaaS + SaaS
‣ If you have trouble remembering:
48
Wednesday, May 25, 2011
89. Summary
‣ What is the Cloud?
• The cloud = IaaS + PaaS + SaaS
‣ If you have trouble remembering:
• Cloud = Platform, Infrastructure & Software as a Service
48
Wednesday, May 25, 2011
90. Summary
‣ With your next PHP application:
• See if you can run it on a Cloud Platform
• See if you can run parts on Cloud Infrastructure
• See if you can use Software as a Service components
• See if you can offer it as a service
• Keep your architecture ‘cloud ready’
‣ Think about clouds!
• In a couple of years, we’ll all be doing it
49
Wednesday, May 25, 2011
91. Food for Thought
Let’s leave you with something to think about
50
Wednesday, May 25, 2011
92. Food for Thought
Are you worried about this?
Cloud
Cloud
Provider
Where’s my
data?!
51
Wednesday, May 25, 2011
93. Food for Thought
Then what about this?
Financial System
Bank
Where’s my
money?!
52
Wednesday, May 25, 2011
94. Food for Thought
Then what about this?
Financial System
Bank
Where’s my
money?!
Our money has been in the cloud since the 18th century!
52
Wednesday, May 25, 2011
96. Credits
Pictures used (under Creative Commons Attribution licenses)
Cloud (slide 3):
http://flickr.com/photos/kables/6324973/
Rubber Band Man:
http://flickr.com/photos/thenovys/3791884189/
Clipart used (royalty free and public domain)
http://www.clker.com/
Wednesday, May 25, 2011