Cloud Foundry Tutorial : Taking a PaaS on the hard stuff
Unless you’ve been living under a rock for the last five years, you’ve probably heard a lot of buzz surrounding “clouds,” and – unless somebody’s given you a clear, specific introduction, you’re no doubt leery of the term. Broadly, “clouds” are being used to describe applications and services that are delivered over the internet through a self-service consumption model: need e-mail but don’t want to learn how to set up Microsoft Exchange or Sendmail? Just sign up for an e-mail account with GMail. Need presentation software or backup software? Sign up for SlideRocket or Mozy. And, if you need a place to run your next application, but don’t want to invest in setting up a datacenter and purchasing or requisitioning hardware, then you can use a compute cloud. This last segment is what we’re going to look at in this article.
IaaS, or Infrastructure-as-a-Service, describes the ability to dynamically set up operating systems (and operating-system resources like RAM, hard disk space, etc.). Common examples of IaaS solutions include Amazon Web Services, and VMware’s vCloud Director. These solutions let you treat a large array of computing resources – hard disks, memory – as a pool from which individual instances may be drawn and used. If your problem is, “I want to set up a new Linux (or Windows or Solaris) machine quickly,” then IaaS is probably what you’re looking for. For a long time, this was what most people thought they wanted.
After all, once you can set up new servers with the literal push of a button, then how “hard could it be to get a working application up and running?” we collectively balked. The trouble is that for most application of any significance, it can be quite daunting. After all, suppose your application is /.’d (or “Oprah”’d or Digg’d), will standing-up Linux machines be enough to meet the demand? Will you be able to get from a Linux machine to a load-absorbing, redundant application instance in time to make a difference?
If you’re on-ramping new developers, will those developers be able to deploy your code base and iterate with it quickly? Or, will they spend the day (week?!) figuring out the unique permutations of drivers, operating system revisions, directory structure combinations and networking settings to get the application even running? Platform-as-a-Service is the answer to these questions.
A PaaS provides push-button deployment of everything below your code: the computing infrastructure (hardware, memory), middleware services (like databases and message queues) and runtimes (like Ruby, Java, or .NET). The ideal is that you can kiss six-month application server requisition tickets and database administration woes goodbye, and focus on your code. Code becomes the currency.
There is one other dimension to this discussion: choice. It’s important to point out what “cloud” does not imply. “Cloud” does not imply publicly-hosted, and it does not imply lock-in. A good PaaS technology will run both on-premise or in somebody else’s datacenter. A good PaaS will be open source, and applications written against it portable and easily moved from one environment to another as the requirements dictate.
Enter Cloud Foundry
CloudFoundry.com is a publicly hosted cloud environment (sign up for an account at www.cloudfoundry.com that is free while the hosted account is in beta), as well as a solution that you can install entirely behind your firewall. You can use BOSH, the Cloud Foundry orchestration engine, to install Cloud Foundry entirely behind your firewall on vSphere, or on Amazon Web Services. Naturally, because it’s open source, there are still other ways to install it in your environment, including Chef recipes and an Ubuntu package.
Cloud Foundry is licensed under the Apache 2 license and has enjoyed very successful ecosystem growth. People have taken the code, forked it, and created their own, more specialized versions of Cloud Foundry. There are, let’s say, more hobby-ist centric ports of Cloud Foundry – supporting Haskell and Erlang – as well as more robust, productized implementations. ActiveState provides a private PaaS called Stackato that supports Python and Perl, in addition to the supported runtimes and languages included in the base release. ActiveState, as many will know, is the leading maker of IDEs and tools for languages like Python, Perl, and TcL. AppFog (formerly PHPFog) provides a PaaS based on Cloud Foundry that supports PHP.
This is all important because it gives you freedom: You can run the application on a publicly hosted environment if you like, to simplify getting started, and – if scale, QoS demands, supported services, or regulatory restrictions require – feel no hesitation in moving the cloud (and your application) in-house, confident that the same command line tools, APIs, and services are supported across environments.