PHP in the Cloud – New Options for Application Hosting
PHP developers today have a few tried and true ways to publish their applications: shared hosting, virtual private servers or dedicated servers. Each of these options bring a variety of trade-offs, such as price, reliability, ease of use, level of control and amount of expertise required. Perhaps you work at a company where you have people dedicated to the vital task of deployment or perhaps you have to wear the deployment hat in addition to the developer hat. If you’re anything like me, you may love writing code and tests, but groan at the prospects of compiling Apache or getting a database cluster configured.
Enter the newcomer to the world of PHP deployment options: Platform as a Service (PaaS). You may be rolling your eyes at the introduction of yet another buzzword and acronym, but before you dismiss it, consider how it might fit in to your application hosting strategy. I’ve heard Platform as a Service described as a “layer above the cloud,” that is, it builds on the existing cloud infrastructure, like Amazon’s EC2, but abstracts away all the setup and maintenance tasks of running an entire server. As David Coallier described it to me, the goal is to “deploy apps, not servers.”
In addition, the goal of Platform as a Service is to make your application environment scalable, reliable and affordable. If your site gets extremely popular in a short period of time, the infrastructure is already there to dynamically allocate more resources to keep your site running at acceptable levels of performance. When the popularity dies down, the environment scales back automatically as well and, best of all, you only pay for the resources you need.
Services like this have existed for some time in the Ruby world, but now we have two new providers offering Platform as a Service for PHP applications. The first is PHPFog. While currently in private beta, I got access to the service and have had a couple weeks to play around with it in preparation for a presentation at the Milwaukee PHP Users Group this month. PHPFog meets all the goals I described above, but didn’t stop there. For one, they provide a git repo for you to publish to when you want to deploy. Deploying your application to their environment is as sample as “git push”. They also provide post-deploy hooks for additional customization. Another interesting feature is that they provide a library of application templates for such projects as WordPress, Drupal, Joomla and even frameworks like Zend Framework, CakePHP and Kohana. You’re not limited to these options, however, so you can deploy any type of project or code that you would like. These templates simply provide an easy way to jump start a project on their end.
Another new option for PHP Platform as a Service hosting is Orchestra. Built by the talented team at echolibre, Orchestra was just announced on the first of this month and is not yet in a private beta. I reached out to the team though and got a walkthrough via Skype from David Coallier. It shares a lot of functionality with PHPFog, but they also have provided some unique functionality that is quite useful. For example, while they also offer git deployment, instead of providing you a new repo to push to, they hook in to your existing public or private repo and automatically pull from it. It is customizable though, so don’t worry that you might accidentally deploy code not ready for prime time. They monitor the specific branch in your repo that you use for production-ready code. If you prefer to deploy from SVN or manually over SSH, they make that available as well. Orchestra also allows you to add features to your hosting environment. Perhaps you want to talk use a specific type of database, you want to make memcache available to your application or you want to integrate with an automated browser-testing solution like SauceLabs; those will be available as “add-ons.”
Platform as a service may not make sense for every site or application, but it’s certainly a welcome addition to the PHP ecosystem. If you’re interested in learning more, I encourage you to visit each site and sign up for early access and more information.