18

I have a Node application running on AWS. When moving into production, there is a very high chance that it will get a very high number of requests. I'm planning to host it using AWS ECS and there will be an AWS Application load balancer in front of the application. When I looked at "How to deploy Node application in production", I saw that everybody is suggesting the use of Nginx in front of Node application.

My doubt is that, if we have the ALB in the architecture do we need to add the Nginx also? Is there any advantage if we use Nginx if we need to host the application for 1 million users?

Neron Joseph
  • 1,675
  • 22
  • 39

2 Answers2

16

It depends on how you are using the NGINX for load balancing. Application Load balancer surely brings a lot of features that can make NGINX redundant in your architecture but it is not exactly as advanced as NGINX. For example ALB only use round robin load balancing, while you can configure nginx for round-robin, least connnection, etc. ALB does not have any caching capabilities while nginx provides static content caching. ALB only uses path based routing while nginx can route on request headers, cookies, or arguments, as well as the request URL.

For further reading and source : https://www.nginx.com/blog/aws-alb-vs-nginx-plus/

Note : One other important fact of using nginx is cloud agnostic. So if you plan to switch cloud provider, you can take the nginx settings with you.

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
1

It depends on the rest of your architecture. If ALB can handle everything for you, you probably don't need nginx. Also, nginx has a learning curve in case you are a first time user.

Ojasvi Monga
  • 4,437
  • 2
  • 18
  • 35