35
Creating PHP Cloud Applications Cory Fowler Windows Azure Technical Evangelist @SyntaxC4 blog.syntaxc4.net http://joind.in/816

Creating php cloud applications

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Creating php cloud applications

Creating PHP Cloud Applications

Cory FowlerWindows Azure Technical [email protected]

http://joind.in/8168

Page 2: Creating php cloud applications

What is the Cloud?

A pool of self-service infrastructure and middleware components which are available on-

demand in near real-time; effectively making IT Infrastructure a

utility

Page 3: Creating php cloud applications

Types of Cloud

IaaSOn-

Premises

SaaS

PaaSPrivateCloud

PublicCloud

Public Cloud Hybrid Cloud Private Cloud

Page 4: Creating php cloud applications

Your Datacenter

Virtualization

O/S

Hardware

Network

Data

Applications

Firewall

Web Sites

Applications

Data

Cloud Services

Applications

Firewall Rules

Data

Virtual Network

Virtual Machines

Virtual Network

Data

Applications

Firewall Rules

O/S

Focus on the Application

Windows Azure

Page 5: Creating php cloud applications

Paradigm Shift…

1. Hardware is a Programmable Resource2. Scale out, over Scale Up.3. Aim for Stateless (or Centralized State) applications4. Decouple application components5. Balancing act of cost, agility, reliability

Page 6: Creating php cloud applications

Programmable Resources

Page 7: Creating php cloud applications

demo

Programmable ResourcesWindows Azure Cross Platform CLI Tools

Page 8: Creating php cloud applications

Environment Automation Resources

Windows Azure CLI Tools http://aka.ms/Azure-SDK-ToolsChef http://aka.ms/Chef

Page 9: Creating php cloud applications

Scale Out, over Scale Up

Page 10: Creating php cloud applications

Scale Out vs. Scale Up

Scale Up Scale Out

Small

Medium

Large

Medium

Medium

Medium

Medium

Medium

Medium

Page 11: Creating php cloud applications

Enter a Load Balancer…

LB

Round RobinClient Affinity

Page 12: Creating php cloud applications

Windows Azure Web Sites InternalsRequest Process Flow for New (Cold) Sites

AzureLB Web Site

SQL

IIS ARR (LB)

Runtime SQL

Web Server

StorageController

Page 13: Creating php cloud applications

Windows Azure Web Sites InternalsRequest Process Flow for Existing (Hot) Sites

AzureLB Web Site

SQL

IIS ARR (LB)

Web Server

StorageController

Web Server A

Web Server A

Web Server C

Page 14: Creating php cloud applications

Windows Azure Web Sites InternalsFTP and Web Deploy Deployment Process

AzureLB

StorageController

Deployment

Servers

Cloud Drive

Web ServerCloud Service

Blob Storage

Legend

Page 15: Creating php cloud applications

Windows Azure Web Sites InternalsGit Deployment Process

AzureLB

StorageController

Cloud Drive

Web ServerCloud Service

Blob Storage

Legend

Page 16: Creating php cloud applications

Supported PHP Versions

FastCGI Bring your own runtime5.4.0

5.3.13

Default Support Customized Support

Change configurations with .user.ini

Load extensions via PHP_Extensions AppSetting

Bin deploy specific PHP Runtime

Configure FastCGI Handler in Web Site Configuration

Uses local php.ini file for extensions and configurations

Page 17: Creating php cloud applications

demo

Load Balanced Web SiteWindows Azure Web Sites

Page 18: Creating php cloud applications

Working with Round Robin Load Balancing

Page 19: Creating php cloud applications

Decoupling Application Components

Page 20: Creating php cloud applications

Tightly Coupled

Store Front End

Drivers

Shipping Service

Tracking

Page 21: Creating php cloud applications

Tightly Coupled

Store Front End

Shipping Service

Drivers

Tracking

Page 22: Creating php cloud applications

Loosely Coupled

Store Front End

Drivers

Shipping Service

Tracking

Order Queue

Page 23: Creating php cloud applications

Loosely Coupled

Store Front End

Order Queue Shipping Service

Drivers

Tracking

Page 24: Creating php cloud applications

Loosely Coupled

Store Front End

Order Queue Shipping Service

Drivers

Tracking

Page 25: Creating php cloud applications

Loosely Coupled

Store Front End

Order Queue

Tracking

Tracking

Shipping Service

Page 26: Creating php cloud applications

Windows Azure SDK for PHP

GitHub: http://aka.ms/AZURESDK-PHP

Developer Center: http://aka.ms/Develop-PHP

Storage

Messaging

Runtime

Manage

Page 27: Creating php cloud applications

composer.json

{ "require": { "microsoft/windowsazure": "*" }, "repositories": [ { "type": "pear", "url": "http://pear.php.net" } ], "minimum-stability": "dev"}

Page 28: Creating php cloud applications

Service Bus Proxy

use WindowsAzure\Common\ServicesBuilder;use WindowsAzure\Common\ServiceException;use WindowsAzure\ServiceBus\models\BrokeredMessage;

$serviceBusRestProxy = ServicesBuilder::getInstance()->createServiceBusService(SERVICE_BUS_CONNECTION_STRING);

// SERVICE_BUS_CONNECTION_STRING:// Endpoint=https://[sb-namespace].servicebus.windows.net;// SharedSecretIssuer=[sb-issuer];// SharedSecretValue=[sb-access-key]

Page 29: Creating php cloud applications

Service Bus Message (Queue)

// Create message$message = new BrokeredMessage();$message->setBody($msg);

// Send message$serviceBusRestProxy ->sendQueueMessage(QUEUE_NAME, $message);

Page 30: Creating php cloud applications

demo

Message MeWindows Azure Service Bus Queue

Page 31: Creating php cloud applications

Cost, Agility and Reliability

Page 32: Creating php cloud applications

“Decoupling” other Resources

• Place static resources in Cloud Storage• Enable a Content Delivery Network (CDN)• Deploy to Multiple Data Centers• Make Geographically Redundant Back-ups

Page 33: Creating php cloud applications

Cory FowlerWindows Azure Technical [email protected]

http://joind.in/8168

Questions?Three truths of cloud computing: hardware fails, software has bugs

and people make mistakes

Page 34: Creating php cloud applications

Resources aka.ms/TEK13-Azure aka.ms/Tek13-Azure-Code aka.ms/WAWS-Cheat aka.ms/WAWS-PHP-Troubleshoot aka.ms/Develop-PHP aka.ms/AZURESDK-PHP aka.ms/WA-Silverlining

Page 35: Creating php cloud applications

© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.