Neron Joseph
Neron Joseph

Reputation: 2365

Does Nginx becomes redundant if we have AWS Application Load balancer for a Node application?

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?

Upvotes: 22

Views: 11681

Answers (2)

Juned Ahsan
Juned Ahsan

Reputation: 68715

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. 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.

Upvotes: 18

Ojasvi Monga
Ojasvi Monga

Reputation: 5129

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.

Upvotes: 3

Related Questions