Top Banner
http://www.egeniq.com [email protected] @egeniq May 2011 Ivo Jansch PHP Development In The Cloud php|tek edition Wednesday, May 25, 2011
96

PHP Development In The Cloud (php|tek edition)

Nov 29, 2014

Download

Technology

Ivo Jansch

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.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PHP Development In The Cloud (php|tek edition)

http://[email protected]

@egeniq

May 2011Ivo Jansch

PHP Development In The Cloudphp|tek edition

Wednesday, May 25, 2011

Page 2: PHP Development In The Cloud (php|tek edition)

What is the Cloud?

2

Wednesday, May 25, 2011

Page 3: PHP Development In The Cloud (php|tek edition)

What is the Cloud?

3

Wednesday, May 25, 2011

Page 4: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

4

Wednesday, May 25, 2011

Page 5: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 6: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 7: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 8: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 9: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 10: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 11: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle

5

Wednesday, May 25, 2011

Page 12: PHP Development In The Cloud (php|tek edition)

Gartner’s Hype Cycle on Clouds

6

Wednesday, May 25, 2011

Page 13: PHP Development In The Cloud (php|tek edition)

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

Page 14: PHP Development In The Cloud (php|tek edition)

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

Page 15: PHP Development In The Cloud (php|tek edition)

NIST: Three Service Models

Cloud applications are:

‣ Software as a Service

‣ Platform as a Service

‣ Infrastructure as a Service

9

Wednesday, May 25, 2011

Page 16: PHP Development In The Cloud (php|tek edition)

NIST: Four Deployment Models

‣ Private cloud

‣ Community cloud

‣ Public cloud

‣ Hybrid cloud

10

Wednesday, May 25, 2011

Page 17: PHP Development In The Cloud (php|tek edition)

Infrastructure as a Service

11

Wednesday, May 25, 2011

Page 18: PHP Development In The Cloud (php|tek edition)

Standard layers in a typical application:

Application Layers

12

Network

Hardware

Operating System

Storage

System Software

Application

Wednesday, May 25, 2011

Page 19: PHP Development In The Cloud (php|tek edition)

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

Page 20: PHP Development In The Cloud (php|tek edition)

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

Page 21: PHP Development In The Cloud (php|tek edition)

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

Page 22: PHP Development In The Cloud (php|tek edition)

The Rackspace Cloud in PHP

16

Wednesday, May 25, 2011

Page 23: PHP Development In The Cloud (php|tek edition)

The Rackspace Cloud in PHP

17

Wednesday, May 25, 2011

Page 24: PHP Development In The Cloud (php|tek edition)

IaaS Architecture Prepare your app to run on IaaS

18

Wednesday, May 25, 2011

Page 25: PHP Development In The Cloud (php|tek edition)

Horizontal Scalability

‣ If you run your app on multiple servers today, would it work?

‣ Typical problem areas:• Sessions

• Files

19

Wednesday, May 25, 2011

Page 26: PHP Development In The Cloud (php|tek edition)

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

Page 27: PHP Development In The Cloud (php|tek edition)

Elasticity

21

Wednesday, May 25, 2011

Page 28: PHP Development In The Cloud (php|tek edition)

Elasticity

22

Wednesday, May 25, 2011

Page 29: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Abstract services where possible

23

Wednesday, May 25, 2011

Page 30: PHP Development In The Cloud (php|tek edition)

Abstraction

24

Wednesday, May 25, 2011

Page 31: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Con:

24

Wednesday, May 25, 2011

Page 32: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Con:• Common denominator functionality

24

Wednesday, May 25, 2011

Page 33: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Con:• Common denominator functionality

• Adds some overhead

24

Wednesday, May 25, 2011

Page 34: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Con:• Common denominator functionality

• Adds some overhead

‣ Pro:• Reduce vendor lock-in

24

Wednesday, May 25, 2011

Page 35: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Con:• Common denominator functionality

• Adds some overhead

‣ Pro:• Reduce vendor lock-in

• Save development time

24

Wednesday, May 25, 2011

Page 36: PHP Development In The Cloud (php|tek edition)

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

Page 37: PHP Development In The Cloud (php|tek edition)

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

Page 38: PHP Development In The Cloud (php|tek edition)

Abstraction

‣ Zend’s SimpleCloud• http://simplecloud.org

• Good attempt at generic cloud abstraction

25

Wednesday, May 25, 2011

Page 39: PHP Development In The Cloud (php|tek edition)

Platform as a Service

26

Wednesday, May 25, 2011

Page 40: PHP Development In The Cloud (php|tek edition)

Complete platform offered as a service:

Platform as a Service

27

Network

Hardware

Operating System

Storage

System Software

Application

Wednesday, May 25, 2011

Page 41: PHP Development In The Cloud (php|tek edition)

The Rackspace Cloud ‘Sites’

28

Wednesday, May 25, 2011

Page 42: PHP Development In The Cloud (php|tek edition)

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

Page 43: PHP Development In The Cloud (php|tek edition)

Other Platforms for PHP

30

Wednesday, May 25, 2011

Page 44: PHP Development In The Cloud (php|tek edition)

Other Platforms for PHP

‣ PHPFog• http://phpfog.com

‣ Orchestra.io

30

Wednesday, May 25, 2011

Page 45: PHP Development In The Cloud (php|tek edition)

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

Page 46: PHP Development In The Cloud (php|tek edition)

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

Page 47: PHP Development In The Cloud (php|tek edition)

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

Page 48: PHP Development In The Cloud (php|tek edition)

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

Page 49: PHP Development In The Cloud (php|tek edition)

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

Page 50: PHP Development In The Cloud (php|tek edition)

Software as a Service

31

Wednesday, May 25, 2011

Page 51: PHP Development In The Cloud (php|tek edition)

Software as a Service

Everything in the cloud:

32

Network

Hardware

Operating System

Storage

System Software

Application

Wednesday, May 25, 2011

Page 52: PHP Development In The Cloud (php|tek edition)

Software as a Service

33

Wednesday, May 25, 2011

Page 53: PHP Development In The Cloud (php|tek edition)

Software as a Service

‣ Complete applications or application components

33

Wednesday, May 25, 2011

Page 54: PHP Development In The Cloud (php|tek edition)

Software as a Service

‣ Complete applications or application components

‣ Popular phrase: “We are moving our ... to the cloud”

33

Wednesday, May 25, 2011

Page 55: PHP Development In The Cloud (php|tek edition)

Software as a Service

‣ Complete applications or application components

‣ Popular phrase: “We are moving our ... to the cloud”

‣ Examples:

33

Wednesday, May 25, 2011

Page 56: PHP Development In The Cloud (php|tek edition)

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

Page 57: PHP Development In The Cloud (php|tek edition)

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

Page 58: PHP Development In The Cloud (php|tek edition)

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

Page 59: PHP Development In The Cloud (php|tek edition)

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

Page 60: PHP Development In The Cloud (php|tek edition)

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

Page 61: PHP Development In The Cloud (php|tek edition)

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

Page 62: PHP Development In The Cloud (php|tek edition)

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

Page 63: PHP Development In The Cloud (php|tek edition)

Example: Salesforce

35

Source adapted from tutorial at http://www.mikesimonds.com

Wednesday, May 25, 2011

Page 64: PHP Development In The Cloud (php|tek edition)

Example: Google Apps

36

Wednesday, May 25, 2011

Page 65: PHP Development In The Cloud (php|tek edition)

General SaaS suggestions

37

Wednesday, May 25, 2011

Page 66: PHP Development In The Cloud (php|tek edition)

General SaaS suggestions

37

Wednesday, May 25, 2011

Page 67: PHP Development In The Cloud (php|tek edition)

General SaaS suggestions

37

Wednesday, May 25, 2011

Page 68: PHP Development In The Cloud (php|tek edition)

General SaaS suggestions

‣ Want to work with X from PHP?

37

Wednesday, May 25, 2011

Page 69: PHP Development In The Cloud (php|tek edition)

General SaaS suggestions

‣ Want to work with X from PHP?• Google ‘X php api’ or ‘X php tutorial’

37

Wednesday, May 25, 2011

Page 70: PHP Development In The Cloud (php|tek edition)

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

Page 71: PHP Development In The Cloud (php|tek edition)

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

Page 72: PHP Development In The Cloud (php|tek edition)

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

Page 73: PHP Development In The Cloud (php|tek edition)

The ‘Warcraft Effect’

Clouds are living entities that change when you’re not looking

38

Wednesday, May 25, 2011

Page 74: PHP Development In The Cloud (php|tek edition)

Creating SaaS

39

Wednesday, May 25, 2011

Page 75: PHP Development In The Cloud (php|tek edition)

Creating SaaS

40

Wednesday, May 25, 2011

Page 76: PHP Development In The Cloud (php|tek edition)

Creating SaaS

‣ Building a single application for multiple users/customers

40

Wednesday, May 25, 2011

Page 77: PHP Development In The Cloud (php|tek edition)

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

Page 78: PHP Development In The Cloud (php|tek edition)

Multi-Tenancy evolution

Source: http://msdn.microsoft.com/en-us/library/aa479069.aspx

41

Wednesday, May 25, 2011

Page 79: PHP Development In The Cloud (php|tek edition)

Multi-tenant Databases

42

Wednesday, May 25, 2011

Page 80: PHP Development In The Cloud (php|tek edition)

Multi-tenant Databases

43

Wednesday, May 25, 2011

Page 81: PHP Development In The Cloud (php|tek edition)

Putting it all togetherCloud Computing In Practice

44

Wednesday, May 25, 2011

Page 82: PHP Development In The Cloud (php|tek edition)

A Hybrid IT Cloud

45

Wednesday, May 25, 2011

Page 83: PHP Development In The Cloud (php|tek edition)

A Hybrid IT Cloud

46

Wednesday, May 25, 2011

Page 84: PHP Development In The Cloud (php|tek edition)

SummaryIf you were sleeping, wake up now!

47

Wednesday, May 25, 2011

Page 85: PHP Development In The Cloud (php|tek edition)

Summary

48

Wednesday, May 25, 2011

Page 86: PHP Development In The Cloud (php|tek edition)

Summary

‣What is the Cloud?

48

Wednesday, May 25, 2011

Page 87: PHP Development In The Cloud (php|tek edition)

Summary

‣What is the Cloud?

• The cloud = IaaS + PaaS + SaaS

48

Wednesday, May 25, 2011

Page 88: PHP Development In The Cloud (php|tek edition)

Summary

‣What is the Cloud?

• The cloud = IaaS + PaaS + SaaS

‣ If you have trouble remembering:

48

Wednesday, May 25, 2011

Page 89: PHP Development In The Cloud (php|tek edition)

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

Page 90: PHP Development In The Cloud (php|tek edition)

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

Page 91: PHP Development In The Cloud (php|tek edition)

Food for ThoughtLet’s leave you with something to think about

50

Wednesday, May 25, 2011

Page 92: PHP Development In The Cloud (php|tek edition)

Food for Thought

Are you worried about this?

51

Cloud

Where’s my data?!

Cloud Provider

Wednesday, May 25, 2011

Page 93: PHP Development In The Cloud (php|tek edition)

Food for Thought

Then what about this?

52

Financial System

Where’s my money?!

Bank

Wednesday, May 25, 2011

Page 94: PHP Development In The Cloud (php|tek edition)

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

Page 96: PHP Development In The Cloud (php|tek edition)

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