Is running Fargate and API Gateway without a load balancer in the production environment a bad idea?

0

I'm looking at a few articles where the author describes how to route traffic from an AWS API Gateway to Fargate tasks without any load balancing.

The solution appear to rely on AWS Service Discovery which, from what I can tell, creates private DNS records.

If my ECS services starts 3 Fargate tasks, is API Gateway smart enough to spread the traffic across all the 3 tasks or not?

  • Hi, I'm thinking about the same choice - leave ALB between API Gateway and ECS Fargate tasks, or try AWS Service Discovery. I'm curious if you have some insights here.

2 Answers
0

No, AWS API Gateway does not automatically spread traffic across multiple Fargate tasks. It only routes traffic to one target. To distribute traffic across multiple tasks, you need to use a load balancer, such as an Application Load Balancer or a Network Load Balancer, in front of the tasks.

profile picture
answered a year ago
0

Running Fargate and API Gateway without a load balancer in a production environment can have potential drawbacks and risks. Without a load balancer, your service may not have automatic failover, scaling, or management of incoming traffic. It can also increase the risk of downtime and decreased performance during traffic spikes. It is recommended to use a load balancer in a production environment to ensure high availability, scalability, and to offload the management of incoming traffic.

profile picture
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions