Search code examples
paascloud-foundry

why is CF able to scale so quickly?


Hi I am a new learner here, and going through the docs in cloud foundry and not able to find much like how Cloud Foundry is able to scale so quickly?

What is there in back which makes it so fast and easy to scale?


Solution

  • I have worked with Pivotal Cloud Foundry and will try to explain concepts with it.

    Here is the link to the Diego Architecture.

    Please look closely to the architecture diagram.

    The diagram depicts the components within PCF and how they interact.

    Cloud Foundry is an ecosystem containing a lot of components. The cells in the diagram are the Diego Cells. These are the actual vm's where containers are hosted and run.

    At basic level, containers are in-fact folders on a host VM, with runtime isolations. A container does not know anything about another container.

    When you push an app to PCF, the first thing that happens is the app is staged. Here is an article explaining How Diego Stages Buildpack Applications.

    Notice the Blobstore. As part of the staging process, the cloud controller uploads a ready-to-go blob to the Blobstore. This blob contains, the OS, monitoring tools (both sourced from stem cell), the runtime (jvm, api tools etc from buildpack), and your application archive.

    Cloud Foundry runs one and only one application in a container. That is very important. If the app dies, the container is reclaimed. A new container will spun up in its place.

    A spinning up a brand new VM is expensive in terms of time and resources. Spinning up a new container on an existing VM is relatively very cheap. And, PCF has a ready-to-go blob available.

    So, if there is a need to scale up or if an app instance crashes, PCF will be able to spin a new instance.

    There are a ton of things involved in this process. The articles will walk you through it.

    Hope this helps.