Monday, May 13, 2019

AWS Fargate vs Cloud Run: Battle of the Serverless Containers

"We are proud to be running our application completely serverless, it has reduced our efforts and costs in the long run."
"Containers have revolutionized our development process. Our developers now exactly know how the application will perform in production."

AWS and Google: "Welcome Serverless Containers"


Yes, serverless containers are here. Are they here to stay? We'll come to know about that.

AWS was first to the punch in this seemingly magical paradigm of deployment with Fargate, which they announced in November 2017. Initially announced with support for just ECS, EKS support is still not present.

Fargate essentially took away the need to manage VMs (nodes) for your ECS cluster. You still need to create tasks through ECS,  Fargate acts like a resource pool for your ECS.

GCP joined the party (kind of) in July 2018 with the announcement of GKE serverless add-on along with Cloud Services Platform (now Anthos). This was recently launched as it's own service, Cloud Run.

Cloud Run is designed to be as simple as possible for the every-developer. With containers becoming the de facto for shipping code, it makes sense to have a service which does all the heavy lifting. All you need to provide is a container image and Cloud Run does everything else for you. It is fully managed, with fast autoscaling, and you can deploy any container on it with an HTTP interface.

Cloud Run provides 2 options for you to use the service: as standalone or as an add-on for GKE. This opens more possibilities.

So what advantages does Fargate have over Cloud Run?

  • Because it was announced earlier, Fargate is currently in GA while Cloud Run is still in Beta as of the writing of this article
  • Fargate is available in 13 regions whereas Cloud Run is available only in the us-central-1 region as of the writing of this article.
But, Cloud Run fares better than Fargate with these points:
  • Cloud Run encapsulates the true serverless container paradigm. You don't even need to create tasks definitions.
  • You can use your existing Kubernetes cluster as a resource pool and abstract away the boring pieces.
My take is that Cloud Run has provided a new possible direction to the industry and others might follow suit.

Which service do you think is better to use? We'd love to hear your thoughts!

Learn more at:
https://aws.amazon.com/about-aws/whats-new/2017/11/introducing-aws-fargate-a-technology-to-run-containers-without-managing-infrastructure/
https://cloudplatform.googleblog.com/2018/07/bringing-the-best-of-serverless-to-you.html
https://cloud.google.com/blog/products/serverless/announcing-cloud-run-the-newest-member-of-our-serverless-compute-stack
https://aws.amazon.com/fargate/
https://cloud.google.com/run/