65

So I've been reading up on Cloud Foundry and yet I'm still confused as to what it is. Here is my take anyway on PaaS on CF, and hopefully you guys could tell me if I'm wrong and explain it a bit better.

A traditional PaaS offering like Microsoft Azure or Google AppEngine provides a full platform to develop, test, host and manage your web app. You must however use their API and are restricted to the services that they offer and languages/frameworks that they support.

Cloud Foundry seems to be some kind of "middle-man", whereby it allows your app to use services from many public clouds. How does it accomplish this? Is there a single API that you use, something like LibCloud or JCloud? Can you use one service from one provider, and another service from another provider, for example? And does Cloud Foundry itself offer any services, or is it merely a middle-man allowing you to easily migrate from one platform to another, and use different service combinations from different providers in a single app?

Guillaume
  • 5,488
  • 11
  • 47
  • 83
Amoeba
  • 1,573
  • 4
  • 19
  • 25

4 Answers4

88

I'm a developer on Cloud Foundry -- and yes, Cloud Foundry is indeed a bit nebulous (no pun intended). Hopefully I can help clarify things a bit.

Cloud Foundry is a platform as a service, but it needs an infrastructure as a service underneath it. Cloud Foundry supports vSphere, vCloud, OpenStack, and Amazon AWS as infrastructures through the BOSH tool. Most web application developers don't care about any of that, but this is really cool for people who have to worry about large IT infrastructure.

Say you're in charge of IT for AcmeCorp. You've got 50,000 employees who all use your internal web service, Fizzbuzz, to help them do their jobs. To support all the employees, you need dozens of instances of the Fizzbuzz application running on several machines with powerful processors and lots of memory, and you need massive amounts of disk space to store information generated by the Foo, Bar, and Baz applications you use internally, too. You've moved well beyond what you would care to manage on your own blade servers, so you decide to lease a datacenter.

Unfortunately, AcmeCorp is horribly dysfunctional. The finance department has a huge say in what datacenter you use, and every couple years they make you switch from one datacenter to another. Every couple years, you have several weeks of downtime while your engineers try to fix bugs in Fizzbuzz exposed by switching between vSphere, vCloud, OpenStack, or whatever.

If your engineers had written Fizzbuzz, Foo, Bar, and Baz against Cloud Foundry rather than directly against the underlying infrastructure, your downtime would have been minimized. You wouldn't have to worry so much about being locked in to a particular datacenter, because that layer of hosting has been abstracted away by Cloud Foundry. Cloud Foundry does support a certain set of services too, including PostgreSQL, MySQL, Mongo, Redis, and RabbitMQ, to name some. If Foo, Bar, and Baz use those services provided by Cloud Foundry, that's one less thing to worry about when you migrate between infrastructures.

Later on down the road, you realize that you can make a fortune by selling Fizzbuzz as a service to other large businesses. You're in really good shape for this: because your engineers rearchitected Fizzbuzz to run on Cloud Foundry, you can simply deploy Cloud Foundry to AWS for as long as it's needed. Customer tried it for six months and decided not to renew the service? No problem, you don't have any datacenter leases to worry about -- just terminate all those EC2 instances and move on. You can easily have one deployment of Cloud Foundry for each instance of Fizzbuzz as a service so that your customers' data is totally isolated from each other.

The icing on the cake is that Cloud Foundry is open source. If you find that it isn't quite suited to your needs, you don't have to just email support and wait around for the Cloud Foundry engineers to implement your dream feature -- you've got the source too, so you can make any changes you need. And it's available under the Apache 2.0 license, so pull requests are gladly accepted, though not required.

I hope that paints a picture of the kinds of problems that Cloud Foundry solves. Feel free to ask for more details in a comment, or you can check out the Cloud Foundry mailing list if that makes more sense for future questions.

Mark Rushakoff
  • 249,864
  • 45
  • 407
  • 398
  • And what is still blurred is pricing? Is cf stack free, and what are you paying? Is there any catch? :) – Tomo Nov 09 '14 at 20:41
  • Mark, great info. What if AcmeCorp was constantly deploying new instances of Fizzbuzz on-premise, each with a slightly different configuration for caching, messaging, logging, database connections, environment variables, etc., can those configurations be parameterized and exposed in a self-service console in CloudFoundry, allowing development teams to provision and deploy new instances of Fizzbuzz as they see fit? – raffian Nov 10 '14 at 04:36
24

I'm a Developer Advocate for Cloud Foundry and want to add a little to Mark's answer to focus on some of the other details you mentioned in your original question.

Firstly, you mention GAE and Azure. Both of these have certain limitations - GAE limits you to specific languages and APIs, for example. Neither are Open Source. CF is extensible (the new version has buildpack support for example, enabling you to choose "any" language runtime), and you can choose to run it where you want.

Mark mentions 4 IaaS providers we can run CF on today, but assuming that the IaaS in question (let's say we include Azure, CloudStack, Google Compute Engine etc as future targets) can support a small number of what we call Cloud Provider Interfaces (CPIs) then you can deploy Cloud Foundry onto those infrastructures too.

You ask how it is possible to use services from different providers. Like Heroku, the forthcoming version of Cloud Foundry (.com) will support a "marketplace" where you can plugin functions from additional vendors, and if you are running your own Cloud Foundry instance you can choose which services to deploy and connect to your apps.

It's pretty cool :-) come talk to us on the mailing list if you want to know more!

Andy Piper
  • 11,422
  • 2
  • 26
  • 49
  • Thanks for filling in the blanks from my answer, Andy! – Mark Rushakoff May 04 '13 at 02:34
  • Thanks to both of you guys, Mark and Andy! I still have a question however regarding the APIs. Is there some kind of generic API that Cloud Foundry provides that allows my app to be generic itself, in the sense that my code will function with whatever IaaS offering I choose? Oh, while I'm at it, are there any code tutorials that can show me how to get started? – Amoeba May 17 '13 at 12:35
  • There's no "Cloud Foundry API" that you need to worry about. If you right a dead standard node.js, Grails, Ruby, etc app then you should be able to just push it to CF without any special code changes. On tutorials, you can take a look at docs.cloudfoundry.com – Andy Piper May 21 '13 at 13:53
  • Great answers and good insights @MarkRushakoff and andy-piper. Thanks for writing this up! – Vishal Biyani Jun 14 '13 at 09:19
6

would like to add this as a comment regarding API to Andy's answer but unfortunately do not have enough reputation to do it. As far as I understand Cloud Foundry really has no specific API, but it provides a lot of useful information via environment variables (e.g. VCAP_SERVICES, VCAP_APPLICATION, VCAP_CONSOLE_IP, VCAP_APP_PORT), that can be accessed from any language or framework. While a lot of info from such variables are internal to Cloud Foundry, some of them might be quite useful. The main one is VCAP_SERVICES that provides information about services, that are bound to your app.

For example, if I would like to gather information about Azure Cloud Service instance (say, its ID), on which my app is currently running, I would use this class from Azure Management Library.

In its turn Cloud Foundry provides VCAP_APPLICATION env. variable, which will contain following fields:

{"application_users": [],
"instance_id":"97467a9cf508cb75273284b948b6319b",
"instance_index":1,
"application_version":"330b7caf-50e5-48f4-8792-1c80a90b06f1",
"application_name":"helloworld",
"application_uris":["helloworld.vcap.me"],
"started_at":"2013-07-22 10:58:16 +0300",
"started_at_timestamp":1374479896,
"host":"0.0.0.0",
"port":61014,
"limits":{"mem":256,"disk":1024,"fds":16384},
"version":"330b7caf-50e5-48f4-8792-1c80a90b06f1",
"name":"helloworld",
"uris":["helloworld.vcap.me"],
"users":[],
"start":"2013-07-22 10:58:16 +0300",
"state_timestamp":1374479896}

And, finally, a few words about logs, monitoring and diagnostic. This is currently not implemented on CF PaaS level, however I hope this will be implemented (as it is a really useful feature) and maybe some new env. variables (say VCAP_LOGS, VCAP_PERFORMANCE_COUNTERS) will be exposed to our apps.

Pavel K
  • 3,541
  • 2
  • 29
  • 44
  • 1
    If you are not able to post comments, you shouldn't use answers as a different option. However I believe this is legitimate as you are improving the answer. I would suggest in future rather than made a new answer, suggest an edit to the existing answer. – Philip Gullick Jul 26 '13 at 11:09
  • "As far as I understand Cloud Foundry really has no specific API" - in fact it does, the Cloud Controller API (documented here http://docs.cloudfoundry.com/docs/reference/cc-api.html). "a few words about logs, monitoring and diagnostic. This is currently not implemented on CF PaaS level" - these features are being added via Loggregator which is under development. – Andy Piper Jul 31 '13 at 15:22
  • 1
    Well, as I understood the API mentioned in question was not the PaaS management API (which, of cause, is implemented in CF and described in the link Andy provided), but the API from the deployed application point of view (the API which could be called by the deployed app). There is no such application API (basically, as I understand, because there is support for huge amount of frameworks). Please, correct me if I am wrong. – Pavel K Aug 01 '13 at 11:42
5

Certainly CF is an abstraction layer between your IaaS (servers, storage and networking) and your application, giving you portability to move your app among public and private clouds, but it is also much more:

1. A highly horizontally-scalable container-based platform

Apps run in containers allowing for better resource management than assigning apps to hosts (VMs). Warden/Garden is the CF-native container technology although Docker is also supported in recent versions.

2. A self-healing platform providing multiple layers of HA to your application

Health management system resurrects failed app instances, container hosts, platform processes, and VMs, with no outage. Availability zone support provides HA at the infrastructure layer. Rolling updates and canary deploys allow for zero down-time even during deployments or platform upgrades.

3. An opinionated, polyglot application run-time

Using the heroku "buildpack" construct, app language is auto-detected and the appropriate runtime stack is built on top of a vanilla OS image, allowing developers to focus on writing code.

4. Developer on-demand provisioning of stateful data services

Developers can self-provision a slice of a MySQL, RabbitMQ, Redis, etc. cluster with uri/credentials automatically injected into their app's environment.

zachb317
  • 51
  • 1
  • 4