windows azure platform + php - jonathan wong
DESCRIPTION
Presentation by Jonathan Wong at PHP User Group Meetup (Apr 27, 2010) .TRANSCRIPT
Windows Azure Platform + PHP
Jonathan WongMicrosoft Innovation Centre Singapore
innovativesingapore.com | twitter.com/innovativesg
The Non-Cloud View
TIME
IT C
APAC
ITY
Actual Load
Allocated IT-
capacities
“Waste“ of capacities
“Under-supply“ of capacities
Fixed cost of IT-capacities
Load Forecast
Barrier forinnovations
Actual Load
Allocated IT capacities
Reduction of initial
investments
Reduction of “over-
supply“
No “under-supply“
Possible reduction of IT-capacities
in case of reduced load
TIME
IT C
APAC
ITY
Load Forecast
However, In a Cloud View
The Microsoft Cloud
Quincy, WA Chicago, IL San Antonio, TX Dublin, Ireland Generation 4 DCs
~100 Globally Distributed Data Centers
The Microsoft Cloud
Introducing the Windows Azure Platform
Private(On-Premise)
Infrastructure
(as a Service)
Platform(as a
Service)
Types of Clouds
Storage
Server HW
Networking
Servers
Databases
Virtualization
Runtimes
Applications
Security & Integration
Storage
Server HW
Networking
Servers
Databases
Virtualization
Runtimes
Applications
Security & Integration
Storage
Server HW
Networking
Servers
Databases
Virtualization
Runtimes
Applications
Security & Integration
You m
anage M
anaged b
y v
endor
Managed b
y v
endor
You m
anage
You m
anage
Private(On-Premise)
Types of Clouds
Infrastructure
(as a Service)
Platform(as a
Service)
Windows Azure for Application Developers
Portal HostedService
Storage
SDK
Develop Deploy Run
Windows Azure Compute Roles
Role
Code Configuration
Web vs. Worker Role
Web Role
IIS Host
Your Code
Worker Role
System Host
Your Code
Sample Application Architecture
Web Role Worker Role
Blob
Queue
http://yourapp.cloudapp.net
Development Fabric and Storage
Local Machine
Windows Azure Simulation Environment
Development Fabric Development Storage
Windows Azure Developer Portal
How does Windows Azure Work with PHP?>Running PHP in Windows Azure
Running PHP in Windows Azure
>How to Do It• Host in Web role
(like .NET)• Supply PHP runtime• Point to runtime via
FastCGI configuration in Web.config Web.roleconfig
PHP Web RoleInstance 2
VIP
Load
Bal
ance
r
PHP Web RoleInstance 1
This is all you need!
\HelloCloudPHPServiceDefinition.csdefServiceConfiguration.cscfg\WebRole
web.roleconfigweb.config\phpindex.php <your php application>etc...
Make sure you change your php.ini to use
relative paths!
How does Windows Azure Work with PHP?>Running PHP in Windows Azure
>Windows Azure Tools for Eclipse
>Windows Azure Command Line Tools for PHP
Windows Azure Tools for Eclipse
>http://windowsazure4e.org
Windows Azure Command-Line Tools for PHP
> Create new applications or convert existing PHP applications to Windows Azure applications
> Deploy to Local Development Fabric or the Windows Azure Cloud
> No IDE required
> http://azurephptools.codeplex.com/
Windows Azure Command-Line Tools for PHP
C:\>php package.php--project=MyProject--source=..\php_source\--phpRuntime="C:\Program Files\PHP\“--target="..\workspace\“--runDevFabric
How does Windows Azure Work with PHP?>Running PHP in Windows Azure
>Windows Azure Tools for Eclipse
>Windows Azure Command Line Tools for PHP
>PHP with Windows Azure Storage
>PHP with SQL Azure
PHP + Cloud Storage
PHPWeb Role
VIP
Load
Bal
ance
r
Windows Azure Storage
SQL Azure
PHP App
Windows Azure Platform
On-Premises
PHP with Windows Azure Storage
>Windows Azure SDK for PHP @ http://phpazure.codeplex.com
>PHP programming model for Windows Azure Storage
>Features • PHP classes for Blobs, Tables & Queues• Store PHP sessions in Table Storage
PHP with SQL Azure
>SQL Server Driver for PHP @ http://sqlsrvphp.codeplex.com/
>Supports PHP access to SQL Azure
>Features• Choose between SQL Server and SQL
Azure by changing connection string• Use from on-premises or in Windows Azure
Migrate MySQL DB to SQL AzureUsing the SQL Server Migration Assistant for MySQL
>http://www.microsoft.com/downloads/details.aspx?FamilyID=0e6168b0-2d0c-4076-96c2-60bd25294a8e
SQL AzureDatabase
SQL Server Migration Assist for MySQL
MySQL Databas
e
How does Windows Azure Work with PHP?>Running PHP in Windows Azure
>Windows Azure Tools for Eclipse
>Windows Azure Command Line Tools for PHP
>PHP with Windows Azure Storage
>PHP with SQL Azure
>Running MySQL in Windows Azure
Running MySQL in Windows Azure
>Running MySQL in a worker role• Copy MySQL to the worker role sub-
directory• Copy to read-write local storage• Configure MySQL to listen on the right port• Monitor MySQL health
>Consuming MySQL• Discover IP address and port• Normal access from then on
Simple Configuration
VIP
Load Balancer
MySQL
Web Role
Worker Role
Replication
VIP
Load Balancer
MySQL MySQLMySQL
MS S
Web Role
Worker Roles
Windows Azure Drive with Hot Spare
VIP
Load Balancer
MySQL MySQL
Web Role
Worker Roles
Windows AzureStorage
Windows Azure MySQL PHP Solution Accelerator
> http://code.msdn.microsoft.com/winazuremysqlphp
> Master/slave configurations in a worker role• Leverage Windows Azure Drive• Master election and replication on startup• Failover and recovery• Scale up/down slaves• Periodic backups - full and incremental
> Available with source code
How does Windows Azure Work with PHP?>Running PHP in Windows Azure
>Windows Azure Tools for Eclipse
>Windows Azure Command Line Tools for PHP
>PHP with Windows Azure Storage
>PHP with SQL Azure
>Running MySQL in Windows Azure
>Solution Accelerators
Solution Accelerators
> http://www.microsoft.com/windowsazure/interop/
> memcached, Tomcat, MediaWiki Solution Accelerators, plus others in the future
> Solution Accelerators are best-practice deployments• Leverage Windows Azure primitives
Windows Azure Drive Windows Azure storage Discovering IP addresses, other servers, lifecycle
• Dynamic Scaling, Failover, and Upgrades• Automation of application lifecycle
Windows Azure Pricing – Compute Services
Variable instance sizes to handle complex workloads of any size
Small
$0.12 per service hour
Medium
$0.24 per service hour
Large
$0.48 per service hour
X Large
$0.96 per service hour
Unit of Compute Defined
Equivalent compute capacity of a 1.6Ghz processor (on 64bit platform)
1.6 GHz(moderate IO)
1.75 GB Memory250 GB Instance Storage
Small
2 x 1.6 GHz(high IO)
3.50 GB Memory500 GB Instance Storage
Medium
4 x 1.6 GHz(high IO)
7 GB Memory1000 GB Instance Storage
Large
8 x 1.6 GHz(high IO)
14 GB Memory2000 GB Instance Storage
X Large
Windows Azure Pricing – Other Services
BandwidthPer GB transfer in or out of a datacenterUS/EU Bandwidth = $0.10 in / $0.15 out / GB Asia Pacific = $0.30 in / $0.45 out / GB
Windows Azure StoragePer GB stored & transactionsBlob & table $0.15 / GBStorage Access = $0.10 / 100K Transactions
Web Edition Per DB per MonthUp to 1GB DB $9.99 + BW charges
Business EditionPer DB per MonthUp to 10GB DB$99.99 + BW charges
Data Transfers Windows Azure and SQL Azure data transfers within a sub-region are not subject to BW charges
Service BusPer connection/month$3.00 connection/month(multi connection packs avail)
Access ControlPer AC transactions/month$.015/100K AC transactions(pay per use basis)
Offers & Promotions
Development Accelerator Designed to accelerate cloud app development. Flexible (on/off) consumption for scaling. Predictable payment and discounted price.
•6 month subscription (38%-45% discount)
•Offered as a unit (can order multiple units)
•Cancel first 30 days; anytime after first 6 months
•Overage at Standard Consumption rates
CORE ($59.95/month)
Amount Included in BaseCompute 750 hrs/mo Storage 10 GB/mo Storage Transactions 1M/mo NET - Messages 1M/moData Transfers 7 GB In / 14 GB Out
EXTENDED ($109.95/month)
Amount Included in BaseSame as Core except also includes 1 SQL Azure Business Edition DB (10 GB)
Introductory Free Offer No-cost developer starter offer. Provides no-cost allocation to run a cloud service.
•Available to all partner/customers
•Limit of one per customer
•Overage at Standard Consumption rates
NO-COSTWindows AzureCompute 25 Hrs/monthStorage 0.5 GB/monthBandwidth 0.5 GB/monthStorage Transactions 10K/month
SQL Azure1 Web Edition DB (1GB DB) 90 day trial
Service Bus and Access Control Service Messages 100K/mo
MSDN Premium Mobilize committed .NET developer base. Enable them to build, deploy, manage multiple cloud projects w/in MSDN subscription.
• Available to MSDN Premium subscribers with limit of one per subscription (one per Windows Live ID)
• 12-month term
• Overage at partner Consumption rates
• Limited time to sign up (thru 6/30/10)
• After 6/30/10 quantities may be reduced
NO-COSTWindows AzureCompute 750 hrs Storage 10 GBStorage Transaction 1M
SQL Azure - 3 Web DB (1 GB)
Service Bus and Access Control Service Messages 1 Million
Data Transfer 7GB In/14GB Out
Sign up at the Windows Azure Platform developers’ portal
Windows Azure accessDeveloper tools White papersSample applications
Plan pilot applications, proofs of concept, and architectural design sessions with Windows Azure partners
http://www.windowsazure.com
Lastly, Microsoft can help your company!
BizSpark• www.bizspark.com
• For startups– Less than 3 years old– Less than USD 1M in annual
revenue– Must make software product or
service
• You get a bunch of free stuff (software, support, visibility)
• Free Windows Azure usage (up to a certain limit)
WebsiteSpark• www.websitespark.com
• For companies that build web sites and applications for their customers– Less than 10 employees
• You get a bunch of free stuff (software, support, visibility)
• No Windows Azure usage unfortunately…
Learn and BuildFree Training on the Microsoft Web Platform
Interested in learning how new innovations in Microsoft's Web Platform and developer tools like ASP.NET 4 and Visual Studio 2010 can make you a more productive web developer?
If you're currently working with PHP, Ruby, ASP or older versions of ASP.NET and want to hear how you can create amazing websites more easily, then register for a Web Camp near you today!
REGISTER TODAY! http://www.webcamps.ms/#singapore_panel
4 -5 June 2010Singapore
function WebCamps() { Day1.Learn(); Day2.Build(); } /* Life Runs On Code */
Thank You!
innovativesingapore.com twitter.com/innovativesg
© 2010 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.