0

I have read many articles that the main advantage of using Nginx as a web server is that it fastens you performance, especially because it works fast with a static data.

I already uses Cloudfront CDN (Amazon Services) for fastening the static data.

So, do I have any real reasons to prefer using Nginx over Node JS as a web server?

Misha Zaslavsky
  • 8,414
  • 11
  • 70
  • 116
  • Can you be more specific about the problem. There are really good reasons to use Nginx over Node or Node over Nginx but it's all problem dependent. The problem you're describing is almost subjective which is why you might be getting down votes. – Harry Apr 22 '16 at 07:04
  • @Harry The program is a social network like Facebook & Linkedin but with a plan of getting 100k thouthands users +- – Misha Zaslavsky Apr 22 '16 at 07:13
  • 4
    Thats not the problem. 100k users can be served by anything, pick your favorite, the one that gives you more features to test etc. It sounds like you need an app server, use Node and use it to serve static files until you see an issue. Don't overcomplicate things without the 100k users because the thing you think will be the performance issue likely won't be. Concentrate on getting the users, without them nothing else matters. – Harry Apr 22 '16 at 07:24

2 Answers2

3

No advantage in your case. Choosing a CDN to deliver your static content was a great idea. (CDN's not only serve your content, but they cache it around their network so most locales see equivalent performance.) This offloads a significant amount of labor from your NodeJS application server.

However NGINX can be very useful in conjunction with an application server like NodeJS. Most people use NGINX as a reverse proxy, that is it sits in front of a cluster of application servers and distributes traffic load evenly.

Other cool tricks include hotswapping NGINX configuration for blue green deployments; so you never have to halt your service for an upgrade.

If you have the money and the time these are tricks well worth having up your sleeve.

Breedly
  • 12,838
  • 13
  • 59
  • 83
0

It depends what do you believe "real reasons" are.

I believe the most important reason includes security issues - Nginx is a dedicated web server, whereas Node.js is a JavaScript runtime, therefore Nginx focuses on serving-related issues, whereas Nodejs builtin server is just an additional utility, thus not receiving that much attention. Another benefit of such deployment is configurability - for example, you can switch your node runtimes with virtually no downtime (since you can run two nodejs instances at the same time) or even slowly move the traffic to your new server.

You can also take a look at: Using Node.js only vs. using Node.js with Apache/Nginx and http://blog.modulus.io/supercharge-your-nodejs-applications-with-nginx

Perhaps you may be interested in a more general question as well, regarding application servers vs web servers: What is the difference between application server and web server?

Community
  • 1
  • 1
Tomasz Lewowski
  • 1,935
  • 21
  • 29