View profile

NGINX Introduction - Software Shots - Issue #7

NGINX Introduction - Software Shots - Issue #7
By Karn • Issue #7 • View online
For this week, I’ll be talking about nginx. I will give you a small shot of introduction and a bit of history of the same. Also I’m surprised how less interested most people are about it in college. I think it should be a mandatory subject for every CS student.

History
It’s not an incredibly old project. It existed since 2004 when it was actually open source by it’s creator Igor Sysoev. And it was written to solve a single problem, the C10K problem - 10,000 Concurrent Connections.
He was trying to build a web server that could handle a lot of stress as he was running into issues with others. And the problem was hence solved and in a pretty good way because of it’s architecture.
After open sourcing, the community started building around it and a commercial wing was created call NGINX, Inc (which got acquired in 2019 by F5, Inc) and they offer a commercial product called NGINX Plus.
Use Cases
There are very few pieces of software that are battle tested as nginx, and you can see that the performace is great and the configuration is relatively simple.
  • High performance web server: used by over 50% of the top 1000 websites.
  • Reverse Proxy: SSL/TLS termination, Content Caching and Compression.
  • Load Balancer: This comes hand in hand with reverse proxy. You can take request for a specific domain/server and route it to the proper backend server on some criteria like round robin or a server with least amount of load.
NGINX vs Apache
One of the common question that you might run into, when you’re looking at a web server to use, is NGINX vs Apache. Apache has been around for a very long time and is used on some very high profile sites. So how do you know which one is which and what are they gonna do a little better.
  • Configuration Language - directive based for both. And when I say directive based, is you have a keyword and that’ll have some arguments. So works very much like a function.
  • Processing methods - NGINX has only one processing method, whereas Apache has multiple as it has been around for a very long time. NGINX uses a worker-process model and has threads that go off and actually handle things, but they’re only ever triggerred by events. So that allows it to work in a very asynchronous way, which is one of the things that helps NGINX get it’s massive amount of concurrent connections.
  • Both can be extended using third party modules, that can be dynamic. By dynamic, I mean that you don’t have to recompile NGINX or Apache in order to use them.
  • Similar performance for Reverse Proxy/Dynamic Content.
  • NGINX is a lot faster for serving static files as compared to Apache.
  • If you’re familiar with Apache, you might know about .htaccess file, which is not present in NGINX. You can use this file to specify, configurations based on a subdirectory rather than having global config for how things can be accessed.
When it comes to getting the most out of the hardware, NGINX is probably a better choice for performance as it’s a very light weight tool.
PS: I prefer NGINX as the configuration language is easier to read. 😛
Also, I encourage you to go through this list here to understand the difference in NGINX Open Source and NGINX Plus. And if you get done with that, do check out OpenResty.
Last week in "Did you have a look at X?"
Apologies for being a bit late with this week’s shot, I was busy deploying a side project that I talked about in my last shot. Quoting my friend about https://lookatx.dev here, “It’s a marathon, not a sprint”. So we’ll be building the features out slowly, and iteratively understanding what’d be the best.
So if you guys can spare a few minutes, have a look at it, submit a feedback, or suggest a feature. That’d be great! Happy Holi 💖 😊
Where we’re going, we don’t need threads: Simulating Distributed Systems – Tech blog
Nate Barbettini – API Throwdown: RPC vs REST vs GraphQL, Iterate 2018
How to Write a Git Commit Message
The Big Little Guide to Message Queues
GitHub - KevinBockelandt/notoire: A vim plugin to take notes using the Zettelkasten method
A successful Git branching model » nvie.com
Stories of reaching Staff-plus engineering roles - StaffEng | StaffEng
Quantum computing for the very curious
I Like That The Boat Is Stuck
GitHub repositories to learn programming
Did you enjoy this issue?
Karn
By Karn

I build and create things. As of now, I work as a Software Engineer at SendX/SendPost.

If you don't want these updates anymore, please unsubscribe here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue
Gyan Karn, Delhi, India - 110039