Late last year, Amazon Web Services (AWS) quietly launched Fargate, a new cloud-based container service. What does Fargate do, and is it right for your containers? Let’s take a look.
To date, Fargate has received surprisingly little press. Most of the coverage from the time of its debut in December 2017 summarized the information from the AWS announcement of the service at re:Invent 2017, and few articles have appeared about Fargate since that time.
The lack of media interest in Fargate perhaps reflects the fact that AWS has launched so many container-related services at this point that it’s hard to keep track of them all. Long before the debut of Fargate, AWS already offered ECS, its containers-as-a-service platform, as well as Lambda, the serverless computing platform that runs on containers (even though that doesn’t matter much from the user’s perspective).
And, of course, you could always spin up containers on any EC2 instance if you take the time to set up the requisite tools yourself.
What Is Fargate?
So what’s the point of Fargate, if AWS already offers so many other ways to run containers? According to AWS, the value of Fargate is that it “allows you to run containers without having to manage servers or clusters.”
What that means is Fargate makes the process of launching and managing containerized applications even easier from the perspective of a developer or IT ops person than it already is running containers using other AWS services.
It’s worth noting that, in general, running containers in the cloud will always be easier than setting up a container environment on-premises. Cloud-based containers save you the hassle of having to configure and manage your own infrastructure. And some AWS services, such as ECS, include built-in tools to assist with managing containers.
Fargate, however, is designed to take the simplicity of containers to the next level by totally removing the need to provision and manage a virtual server to run an application inside containers. With Fargate, you simply tell AWS how many resources you want to make available to your containerized application, then launch the application.
Fargate: Lambda for Your Containers
In a way, then, Fargate does for Docker containers what Lambda does for application code: It lets you run your containers without really having to think at all about the infrastructure that hosts them. AWS handles all of the infrastructure headache for you, so that you can focus on your application itself instead of deployment and management.
Should You Use AWS Fargate?
Does this make Fargate a good value? That question is more difficult to answer.
From a cost perspective, Fargate may not be a good choice in most cases. As Nicholas Wolverson has pointed out, the price of running a container using Fargate is significantly higher than setting up your own EC2 instance and running containers there.
Of course, setting up an EC2 instance takes time and effort. If your goal is to launch a container quickly, the time you save by using Fargate instead of a pure-play EC2 instance might be worth the extra Fargate cost.
In this sense, again, it may be useful to think of Fargate in the same way you think of Lambda. Overall, running a serverless function on Lambda costs a lot more than setting up an EC2 instance that is tailored to your application and running your application there. But what Lambda offers that EC2 on its own does not is the ability to execute an application (or part of an application) very quickly, and to run it only for a limited amount of time. For certain types of workloads, these Lambda benefits are well worth the price.
So, if you have a containerized application that you want to spin up quickly, Fargate may be a good solution. This is especially true if you don’t expect to be running the application permanently. Otherwise, ECS or EC2 are probably better solutions for your container-deployment needs.
The bottom line: Fargate is another useful tool for running containers in the cloud, but it is only one of several solutions that developers and admins should consider for a cloud-native container strategy.