Scaling PHP on Windows Azure with new SDK and Sample Kits
I’m currently attending the PHP Tek Conference in Chicago, Illinois this week with a couple of my Microsoft colleagues, including Craig Kitterman, Mark Brown, and Brian Prince. Tek is a conference where great minds from the PHP community come together to share some great content. One of the common themes I’ve been witnessing across many of the sessions has been cloud computing. There have been sessions that went deep on how various cloud platforms & tools work, to more general sessions on design patterns for cloud applications.
I delivered one of those presentations, focusing on scaling PHP applications on Windows Azure (slides below).
During my session, I was happy to share some new announcements regarding PHP on Windows Azure:
- The Windows Azure SDK for PHP version 3.0 has been released.
- A new Windows Azure Sample Kit for PHP featuring two sample applications:
- “Deal of the Day”, sample application and live contest (https://dealoftheday.cloudapp.net)
- “PHP Guestbook”, a PHP implementation of the .NET Guestbook sample application from the Windows Azure Training Kit
Windows Azure SDK for PHP 3.0
The Windows Azure SDK for PHP has been evolving since the early days of Windows Azure in 2009. This latest release adds access to a lot more of the Windows Azure REST APIs, including ones for Azure service management and a new logging infrastructure. Maarten Balliauw from Real Dolmen has been one of the lead developers on this open source SDK. He has all the details of the new release covered over on his blog.
PHP Guestbook ***
For PHP Tek, I wanted to have a good working sample that covered some of the core features of the Windows Azure SDK for PHP. This includes access to the Windows Azure Storage services: Blobs, Tables, and Queues.
Having spent a lot of time in the .NET-based Windows Azure Training Kit, I decided the Guestbook demo application would make a great sample for PHP developers looking to see the Windows Azure PHP SDK in action. So, with some help from Craig Kitterman, I re-wrote the Guestbook application entirely in PHP!
The code is still a ‘work in progress’, but it has been posted on GitHub as part of the Windows Azure Sample Kit for PHP project. I plan on documenting the application, code, and setup in a future blog post. However, there is a basic setup document in the project currently if you want to look at the code and see how the SDK works. It’s been a great experience getting to work with the tools first hand the past couple of weeks.
If folks find this sample to be of interest, the Interoperability @ Microsoft team may consider building more of the .NET Training Kit sample applications in PHP. So give us your feedback by commenting on my blog or theirs!
Deal Of The Day ***
The folks on the Interoperability @ Microsoft team also have published a sample application called “Deal of the Day”. This application uses the service management features of the new 3.0 SDK to demonstrate how to utilize Windows Azure’s scalability features from within PHP. It contains a worker role process that monitors the site’s usage and can auto-scale up or down based on configurable threshold parameters.
The application itself is a contest that awards little prizes. The Interoperability team deployed a live version on Windows Azure to give you a chance to test it for real, but also to win some actual fun prizes*! Check it out here: https://dealoftheday.cloudapp.net/
* Prizes available to US residents only due to big thick red tape. Sorry.
** The toothpick & mints, and screwdriver kit prizes are nice, but you’re not missing out on much. :)
Also on this topic, Ben Lobaugh has two great posts on Scaling PHP Applications on Azure up on the Interoperability Bridges site:
- Scaling PHP Applications on Windows Azure Part I: Performance Metrics
- Scaling PHP Applications on Windows Azure Part II: Role Management
*** Demo Code Disclaimer
This is a “demo code disclaimer” for BOTH the Guestbook & Deal of the Day samples. As a sample applications, these applications did not undergo extensive testing, nor does the code include all the required error catching, security verifications and so on, that an application designed for real production would require. So, do expect glitches.
If you have issues with the DoTD code, send the Interop team a screenshot showing error messages with a description. If you have issues with the Guestbook application, post a comment here or contact me through my blog.