AWS EC2 on ECS vs Fargate | Whats the Difference and When To Use What?

preview_player
Показать описание
In the world of containers, there are many options for running your virtual images on the cloud. In this video, I compare and contrast two popular options for hosting containers on AWS: EC2 on ECS vs Fargate. Both of these technologies take advantage of ECS control plane to orchestrate your containers. However, there are numerous pros and cons associated with using either technology. In this video, we'll describe the difference between these two options. We'll go over some key terms in the world of ECS that you need to know about. Finally, I'll provide some guidance on when to use one option over the other.

Relevant Videos:

🎉SUPPORT BE A BETTER DEV🎉

📚 MY RECOMMENDED READING LIST FOR SOFTWARE DEVELOPERS📚

🎙 MY RECORDING EQUIPMENT 🎙

💻 MY DESKTOP EQUIPMENT 💻

🌎 Find me here:

#AWS
#ECS
#Fargate
#EC2
#Beabetterdev
Рекомендации по теме
Комментарии
Автор

This is the best explanation I’ve heard yet.

JitoTantrum
Автор

Excelent explanation and very well presented ! Thx for sharing!

DC-xtry
Автор

I am watching X vs Y in AWS videos in preparation for an AWS certification exam. These videos are straight and to the point.

ftcivmq
Автор

I've never met this guy (or have I) but here he is helping me out again! Thank you for the great video bud.

DuyNguyenH
Автор

Nice video. As an fyi: we use Fargate and split our clusters based on the type of logging the underlying services and tasks produce. All services log to a single cloudwatch log group, you can then grok the logs in that log group based on the type of logs created by the services\tasks inside them.

RicusNortje
Автор

Always great videos and your site has become a reference one for topics i look for.
Thanks for sharing...

vimalneha
Автор

Best AWS videos. I have signed up for a variety of AWS training courses, but sometimes i will listen to others speak for 20 minutes, and at the end of the video, they succeed in just confusing me more. So many of these services sound very similar, by doing a comparison of the services it helps me understand this stuff better.

JohnS-erjh
Автор

Thank you. Great work and useful video for recap in this busy world ;)

larhard
Автор

Thank you for this wonderful explanation 🙌🏾

raphaelaneng
Автор

Thanks! Great content. Your channel is a gem

vladkodenko
Автор

This is really good! I'm subbing!

SH-osck
Автор

One more thing to note, as you mentioned, running EC2 outside of ECS is completely viable. You can even have autoscaling by putting it in an ASG, and traffic routing to each instance via ELB. Since you manage everything manually, you can get maximum usage out of the hardware, and this is the lowest-cost way of doing it.

FinaISpartan
Автор

Some other reasons you might NOT use Fargate:
- You cannot cache container images, even from AWS Elastic Container Registry, they need to transfer across the wire for every task
- The startup time is longer, due to setting up the networking and things like allocation.

Typically, fargate will add approximately 20-30 seconds from the invocation of startTask (for example).

EC2 instances with ECS, startup is much quicker and it can cache the images.

GabrielCrowe
Автор

We use Fargate in work and to be honest, when I heard about it first, I thought it sounded like some kind of alien transportation device ahahahaha

AJ_real
Автор

great content as always, thanks!
Would be awesome to hear your opinion on using AWS Batch with Fargate!

luiztauffer
Автор

The main feature you forgot to mention and from my point of view is the key feature in choosing is the having persistent storage available for docker containers when we use EC2+ECS.

ruslanmustaev
Автор

Great summary. Love serverless everything

rickharold
Автор

great video if possible can you add one video for costing difference between also

shashankgupta
Автор

I changed from business management to I.T. I hope these videos will help me, but the curve is steep.

susanca
Автор

Great video! There is one subtle error though: you say that _container_ is a term used only when running an ECS cluster on EC2. This is not true. _Containers_ are the smallest primitive that is used to define what you want to run and as such are part of the Task Definition, both for tasks run on Fargate as well as EC2.

Quote from the AWS Fargate docs:
"The task definition is a text file (in JSON format) that describes one or more *containers* (up to a maximum of ten) that form your application."

What you're confused with are Container _Instances_ . Container Instances are EC2 instances specifically reserved for running ECS containers (which are part of tasks). Container Instances are illustrated well on the diagram you show at 8:33. So when you're explaining how tasks run inside a container (9:30), what you really mean is that tasks are running inside container _instances_ . Interestinly, you could make the diagram even more complete by drawing containers _inside_ the tasks, because technically each task can contain 1 _or more_ containers. (although usually, you'd run 1 container per task)

DandyDev