Search code examples
containersserverlessapp-engine-flexible

What is the difference between Serverless containers and App Engine flexible with custom runtimes?


I came across the article : Bringing the best of serverless to you where I came to know about upcoming product called Serverless containers on Cloud Functions which is currently in Alpha.

As described in the article:

Today, we’re also introducing serverless containers, which allow you to run container-based workloads in a fully managed environment and still only pay for what you use.

and in GCP solutions page

Serverless containers on Cloud Functions enables you to run your own containerized workloads on GCP with all the benefits of serverless. And you will still pay only for what you use. If you are interested in learning more about serverless containers, please sign up for the alpha.

So my question is how this serverless containers different from app engine flexible with custom runtime, which also use a docker file?

And it's my suspicion, since mentioned named is Serverless containers on Cloud Functions, the differentiation may include role of cloud functions. If so what is the role played by cloud functions in the serverless containers?

Please clarify.


Solution

  • What is a Serverless Container?

    As stated on the official blog post (search for Serverless Containerss), it's basically a Cloud Function running inside a custom environment defined by the Dockerfile.

    It is stated on the official blog post:

    With serverless containers, we are providing the same underlying infrastructure that powers Cloud Functions, but you’ll be able to simply provide a Docker image as input.

    So, instead of deploying your code on the CF, you could also just deploy the Docker image with the runtime and the code to execute.

    What's the difference between this Cloud Functions with custom runtimes vs App Engine Flexible?

    There are 5 basic differences:

    1. Network: On GAE Flexible you can customize the network the instances run. This let's you add firewalls rules to restrict egress and ingress traffic, block specific ports or specify the SSL you wish to run.

    2. Time-Out: Cloud Functions can run for a maximum of 9 minutes, Flexible on the other hand, can run indefinitely.

    3. Ready only environment: Cloud Functions environment is read-only while Flexible could be written (this is only intended to store spontaneous information as once the Flexible instance is restarted or terminated, all the stored data is lost).

    4. Cold Boot: Cloud Functions are fast to deploy and fast to start compared to Flexible. This is because Flexible runs inside a VM, thus this extra time is taken in order for the VM to start.

    5. How they work: Cloud functions are event driven (ex: upload of photo to cloud storage executing a function) on the other hand flexible is request driven.(ex: handling a request coming from a browser)

    As you can see, been able to deploy a small amount of code without having to take care of all the things listed above is a feature.

    Also, take into account that Serverless Containers are still in Alpha, thus, many things could change in the future and there is still not a lot of documentation explaining in-depth it's behavior.