220 likes | 365 Views
Running PHP on the Windows Azure Platform. Brian Swan PHP Developer Advocate Microsoft brian.swan@microsoft.com @ brian_swan http://blogs.msdn.com/b/brian_swan http://blogs.msdn.com/b/silverlining. Lots I could talk about…. Why is PHP 5.3 faster on Windows than previous versions of PHP?
E N D
Running PHP on the Windows Azure Platform Brian Swan PHP Developer Advocate Microsoft brian.swan@microsoft.com@brian_swan http://blogs.msdn.com/b/brian_swan http://blogs.msdn.com/b/silverlining
Lots I could talk about… • Why is PHP 5.3 faster on Windows than previous versions of PHP? • Version 3.0 (beta) of the SQL Server Driver for PHP is available. • SQL Server ODBC driver for Linux is coming. • Hadoop for Windows Server/Azure is coming.
Windows Azure Platform Overview • Developer Experience • Use existing skills and tools. AppFabric Management Relational data Management Compute Storage Connectivity Access control ON-PREMISES LOB Applications Composite applications
What type of cloud is Windows Azure? Infrastructure (as a Service) Platform (as a Service) Packaged Software Software (as a Service) Applications Applications Applications Applications You manage Data Data Data Data You manage Runtime Runtime Runtime Runtime Managed by vendor Middleware Middleware Middleware Middleware Managed by vendor You manage O/S O/S O/S O/S Virtualization Virtualization Virtualization Virtualization Managed by vendor Servers Servers Servers Servers Storage Storage Storage Storage Networking Networking Networking Networking
What are Web and Worker roles? In general, think of a “role” as on OS template. • Worker Role • Internal Facing • TCP/HTTP Endpoint • Long running processes • (Think Service or Deamon) • Web Role • External Facing • HTTP/HTTPS Endpoint • Short lived calls • (Think Web Server) • There is also a VM Role • You configure and maintain the OS. • Lacks persistent state.
What is Azure Storage? Tables: simply (and loosely) structured data(not relational) Blobs: large, unstructured binary data (audio, video, etc.) Queues: serially accessed messages • Storage Costs $0.14 GB/month* $0.01/10k transactions Don’t forget • Transfer Costs $0.15 GB outbound * http://blogs.msdn.com/b/windowsazure/archive/2011/10/27/microsoft-lowers-storage-cost-for-blob-and-table-storage-in-windows-azure.aspx
Azure Table Storage Query Performance
Account Container • Blob Azure Blob Storage http://<account>.blob.core.windows.net/<container>/<blobname> • PIC01.JPG • images PIC02.JPG • mymedia VID01.AVI • videos
Containers and Blobs • Containers • Multiple containers per account • Create/destroy on the fly • One container can hold up to 100 TB* worth of blobs • Set access policies (private, public read, full public read) • Set metadata • No search/query (i.e. no WHERE MetadataValue = ?) • Blobs • A blob can be up to 1 TB in size • Set access policy • Set metadata *100 TB is the size limit for an entire storage account
What is the Diagnostics Monitor? An Azure component (MonAgentHost.exe) that collects diagnostic data for application instances • Starts automatically by default • Must define a storage account connection string
How does it work (in a nutshell)? Role Instance • Role Instance Starts • Diagnostic Monitor Starts • Monitor is configured • Imperatively at Start time • Remotely any time • Monitor buffers data locally • User can set a quota (FIFO) • User initiates transfer to storage • Scheduled or On Demand Role Local directory storage Diagnostic Monitor Windows Azure Storage
What is the Management API? • A REST API that allows you to manage services under an Azure subscription. • Examples include… • Create/stop/start/delete a deployment • Move staging deployment to production • Increasing the number of instances • Initiate a rolling upgrade • Etc. • (almost anything you can do via the management portal) • All API calls must be signed with an X509 certificate
Windows Azure SDK for PHP • http://phpazure.codeplex.com/ • Open Source project • Mostly platform independent (only the packaging tools have a Windows dependency) • Features • PHP classes for Windows Azure Blobs, Tables & Queues • Scaffolds for quick application deployment • Helper Classes for HTTP transport, AuthN/AuthZ, REST & Error Management • Manageability, Instrumentation & Logging support • Support for storing PHP sessions in Azure Table Storage • Management API client • Diagnostics client • Command line tools set for packaging, management , diagnostics, and deployment
Demo Auto-scaling a Windows Azure/PHP application Windows Azure SDK for PHP + …
Code • GolferMessageBoard code is on the TechNet Wiki: http://social.technet.microsoft.com/wiki/contents/articles/use-the-windows-azure-web-role-and-windows-azure-blob-service-with-php.aspx • Auto-scaling code is on GitHub: https://github.com/brian-swan/PHP-Auto-Scaler • Read about it here: http://blogs.msdn.com/b/silverlining/archive/2011/10/05/an-auto-scaling-module-for-php-applications-in-windows-azure.aspx
Other Resources • http://blogs.msdn.com/b/silverlining • A PHP on Windows Azure Learning Plan • http://blogs.msdn.com/b/brian_swan • https://github.com/brian-swan • http://azurephp.interoperabilitybridges.com/ • Why is PHP 5.3 faster on Windows than previous versions of PHP? • Version 3.0 (beta) of the SQL Server Driver for PHP is available. • SQL Server ODBC driver for Linux is coming. • Hadoop for Windows Server/Azure is coming.
Try It Out http://www.microsoft.com/windowsazure/free-trial/