http://[email protected]
@egeniq
May 2011Ivo Jansch
PHP Development In The Cloudphp|tek edition
Wednesday, May 25, 2011
What is the Cloud?
2
Wednesday, May 25, 2011
What is the Cloud?
3
Wednesday, May 25, 2011
Gartner’s Hype Cycle
4
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle
5
Wednesday, May 25, 2011
Gartner’s Hype Cycle on Clouds
6
Wednesday, May 25, 2011
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
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
NIST: Three Service Models
Cloud applications are:
‣ Software as a Service
‣ Platform as a Service
‣ Infrastructure as a Service
9
Wednesday, May 25, 2011
NIST: Four Deployment Models
‣ Private cloud
‣ Community cloud
‣ Public cloud
‣ Hybrid cloud
10
Wednesday, May 25, 2011
Infrastructure as a Service
11
Wednesday, May 25, 2011
Standard layers in a typical application:
Application Layers
12
Network
Hardware
Operating System
Storage
System Software
Application
Wednesday, May 25, 2011
Infrastructure as a Service
Parts of the infrastructure offered as service to your app:
13
Network
Hardware
Operating System
Storage
System Software
Application
Wednesday, May 25, 2011
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
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
The Rackspace Cloud in PHP
16
Wednesday, May 25, 2011
The Rackspace Cloud in PHP
17
Wednesday, May 25, 2011
IaaS Architecture Prepare your app to run on IaaS
18
Wednesday, May 25, 2011
Horizontal Scalability
‣ If you run your app on multiple servers today, would it work?
‣ Typical problem areas:• Sessions
• Files
19
Wednesday, May 25, 2011
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
Elasticity
21
Wednesday, May 25, 2011
Elasticity
22
Wednesday, May 25, 2011
Abstraction
‣ Abstract services where possible
23
Wednesday, May 25, 2011
Abstraction
24
Wednesday, May 25, 2011
Abstraction
‣ Con:
24
Wednesday, May 25, 2011
Abstraction
‣ Con:• Common denominator functionality
24
Wednesday, May 25, 2011
Abstraction
‣ Con:• Common denominator functionality
• Adds some overhead
24
Wednesday, May 25, 2011
Abstraction
‣ Con:• Common denominator functionality
• Adds some overhead
‣ Pro:• Reduce vendor lock-in
24
Wednesday, May 25, 2011
Abstraction
‣ Con:• Common denominator functionality
• Adds some overhead
‣ Pro:• Reduce vendor lock-in
• Save development time
24
Wednesday, May 25, 2011
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
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
Abstraction
‣ Zend’s SimpleCloud• http://simplecloud.org
• Good attempt at generic cloud abstraction
25
Wednesday, May 25, 2011
Platform as a Service
26
Wednesday, May 25, 2011
Complete platform offered as a service:
Platform as a Service
27
Network
Hardware
Operating System
Storage
System Software
Application
Wednesday, May 25, 2011
The Rackspace Cloud ‘Sites’
28
Wednesday, May 25, 2011
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
Other Platforms for PHP
30
Wednesday, May 25, 2011
Other Platforms for PHP
‣ PHPFog• http://phpfog.com
‣ Orchestra.io
30
Wednesday, May 25, 2011
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
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
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
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
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
Software as a Service
31
Wednesday, May 25, 2011
Software as a Service
Everything in the cloud:
32
Network
Hardware
Operating System
Storage
System Software
Application
Wednesday, May 25, 2011
Software as a Service
33
Wednesday, May 25, 2011
Software as a Service
‣ Complete applications or application components
33
Wednesday, May 25, 2011
Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
33
Wednesday, May 25, 2011
Software as a Service
‣ Complete applications or application components
‣ Popular phrase: “We are moving our ... to the cloud”
‣ Examples:
33
Wednesday, May 25, 2011
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
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
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
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
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
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
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
Example: Salesforce
35
Source adapted from tutorial at http://www.mikesimonds.com
Wednesday, May 25, 2011
Example: Google Apps
36
Wednesday, May 25, 2011
General SaaS suggestions
37
Wednesday, May 25, 2011
General SaaS suggestions
37
Wednesday, May 25, 2011
General SaaS suggestions
37
Wednesday, May 25, 2011
General SaaS suggestions
‣ Want to work with X from PHP?
37
Wednesday, May 25, 2011
General SaaS suggestions
‣ Want to work with X from PHP?• Google ‘X php api’ or ‘X php tutorial’
37
Wednesday, May 25, 2011
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
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
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
The ‘Warcraft Effect’
Clouds are living entities that change when you’re not looking
38
Wednesday, May 25, 2011
Creating SaaS
39
Wednesday, May 25, 2011
Creating SaaS
40
Wednesday, May 25, 2011
Creating SaaS
‣ Building a single application for multiple users/customers
40
Wednesday, May 25, 2011
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
Multi-Tenancy evolution
Source: http://msdn.microsoft.com/en-us/library/aa479069.aspx
41
Wednesday, May 25, 2011
Multi-tenant Databases
42
Wednesday, May 25, 2011
Multi-tenant Databases
43
Wednesday, May 25, 2011
Putting it all togetherCloud Computing In Practice
44
Wednesday, May 25, 2011
A Hybrid IT Cloud
45
Wednesday, May 25, 2011
A Hybrid IT Cloud
46
Wednesday, May 25, 2011
SummaryIf you were sleeping, wake up now!
47
Wednesday, May 25, 2011
Summary
48
Wednesday, May 25, 2011
Summary
‣What is the Cloud?
48
Wednesday, May 25, 2011
Summary
‣What is the Cloud?
• The cloud = IaaS + PaaS + SaaS
48
Wednesday, May 25, 2011
Summary
‣What is the Cloud?
• The cloud = IaaS + PaaS + SaaS
‣ If you have trouble remembering:
48
Wednesday, May 25, 2011
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
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
Food for ThoughtLet’s leave you with something to think about
50
Wednesday, May 25, 2011
Food for Thought
Are you worried about this?
51
Cloud
Where’s my data?!
Cloud Provider
Wednesday, May 25, 2011
Food for Thought
Then what about this?
52
Financial System
Where’s my money?!
Bank
Wednesday, May 25, 2011
Food for Thought
Then what about this?
52
Financial System
Where’s my money?!
Bank
Our money has been in the cloud since the 18th century!
Wednesday, May 25, 2011
Thank you! Questions?
http://[email protected]
@egeniq
http://joind.in/3423http://www.egeniq.com
[email protected]@ijansch
Wednesday, May 25, 2011
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