Web Server, HTTP Methods & Node.js

Zahidul Islam Joy
3 min readDec 22, 2020

“What is a web server? What are the HTTP methods? What is node.js?How does it work?”_ Do you ever feel curious about these? If your answer is YES, then this is the right place for you.

What is a Web Server?

Basically, a web server is a computer that runs websites. A web server is used to store, process, and deliver the web pages to users. Communication with a web server is done by using HTTP requests. When a user makes a request for a website through an URL to the internet, a DNS converts the URL to an IP address that points to the targeted server.

Different Types of Web Server

There are mainly 4 types of web servers.

Apache HTTP Web Server

Developed by Apache Software Foundation. It is an open-source web server which supports almost all operating system. Approximately, 60% of the machines run on Apache web server.

Internet Information Services ( IIS) Web Server

IIS web server is a Microsoft product and it is not open-source. It supports all the platform that runs on windows operating system.

Nginx Web Server

Nginx is also an open-source web server like apache. The significant features offered by Nginx are high performance, stability, Simple configuration, and low resource.

LightSpeed Web Server

LightSpeed is one of the most popular web server on the internet and is a commercial web server. It has the ability to load Apache configuration files directly and work as a drop-in replacement Apache with almost all the hosting control panels. It can replace Apache within 15 minutes without any downtime.

HTTP Request Methods

HTTP requests are messages sent by the client to initiate an action on the server. And these requests are sent by some HTTP methods. The most commonly used HTTP Request Methods are GET, POST, PUT, PATCH, DELETE.

GET

GET is used to request data from a specified resource. It is only used to request data. It can’t modify or post data to the web server. GET requests should not be used when dealing with sensitive data. GET requests have length restrictions on data. GET requests are cached, it remains in the browser history.

POST

POST requests are used when data is sent to a server to create/update a resource. The data sent to the server with POST is stored in the request body of the HTTP request. POST requests are never cached. POST requests don’t have any length restrictions.

PUT

PUT requests are also used to send data to a server to update a resource. The difference between POST and PUT is that PUT requests are idempotent. That is, calling the same PUT request multiple times will always produce the same result. In contrast, calling a POST request repeatedly have side effects of creating the same resource multiple times.

PATCH

PATCH request is used to update or modify data. It is used to apply partial modification to the target resource. On the other hand, PUT requests replace the full target resource with the data that is sent via that request.

DELETE

DELETE request is used to delete a specified resource from a database.

What is Node.js?

Node.js is an asynchronous, Event-driven, single-threaded, Non-Blocking Javascript runtime that is built on JavaScript Chrome’s V8 Engine. It is designed to build scalable network applications.

Node.js Building Blocks & Architecture

Node.js use Chrome V8 Engine, Javascript, C++, and a high-performance cross-platform evented I/O library.

Node.js uses a Single-Threaded Event loop architecture to handle multiple concurrent server requests. Parts of Node.js architecture:

  1. Requests
  2. Node.js Server
  3. Event Queue
  4. Thread Pool
  5. Event Loop
  6. External Resources

--

--