Web Servers in Backend Engineering

Learn the intricacies of web servers in backend engineering

Hello “👋”

Welcome to another week, another opportunity to become a Great Backend Engineer.

Today’s issue is brought to you by MasteringBackend—a great resource for backend engineers: Next-level Backend Engineering training and Exclusive resources.

Before we get down to the business of today. Exploring Servers for Backend Engineers.

I have a special announcement:

The pioneer product of this newsletter is launching its learning platform for backend engineers in the first week of February.

Read about all the features here -> Masteringbackend and Demo here.

We offer a special discount and benefits to specific individuals (just 10 persons) called SuperFan.

Here are the benefits of a SuperFan:

  1. Lifetime access to MasteringBackend Platform, including unlimited access to all courses(Text, Video), Projects, Roadmaps, Tasks, Backend Challenges, etc

  2. Lifetime access to the Get Backend Jobs platform, including unlimited access to Backend-Only Jobs, Manage Job Applications, Create Job Streak, etc. (https://gbj.vzy.io)

  3. Unlimited Access to our Backend Engineering Community (https://masteringbackend.com/community)

  4. Unlimited Access to our Premium Newsletter (https://masteringbackend.beehiiv.com)

We are also releasing the following courses before ending of March this year.

You will have access to all these courses and more that will be released without paying a dime.

Subscribing to the Super Fan one-time plan gives you full benefit. As long as masteringbackend.com exists, you have paid in full.

Imagine having this opportunity to pay once and use it forever with Udemy, Coursera, Eductive, and Codecademy, to mention a few.

That’s exactly what Mastering Backend is offering now. It's a one-time thing, and it's ending today.

Now, back to the business of today.

What is a Server?

Servers are the bedrock of backend engineering, hence the name Server-Side Development. In the client-server architecture, when a client sends an HTTP request, as discussed above, an application somewhere on the server side will receive this request, process it, and return a response to the client. This application or hardware is called a server.

What is a Server?

A server is an application or hardware that receives and processes requests transmitted over the network, providing appropriate responses. To break things down, the device that makes the request is called the Client, while the device that receives and processes the request is called the Server. This system of sending requests and receiving responses is called Client-Server Architecture.

What are they used for?

Servers are used for numerous things, and they are especially used to manage network resources. As a Backend Engineer, you can set up a server to receive and send emails, respond to HTTP requests, manage print jobs, or host a website.

Also, many types of servers depend on what you want to achieve. Here is a list of some of the servers you can use.

  • Application server â€”> This is a dedicated server set up to serve a specific set of software. For instance, you may sign up for online gaming and be directed to servers set up solely for the gaming software.

  • Blade server: A blade server is a computing device for data management and distribution across interconnected computers and systems.

  • Cloud server: A cloud server is a server, either virtual or physical, that is hosted remotely by a cloud service provider, and customers can access it through an internet connection.

  • Database server: A database server is equipped with a database application, offering database services to other computer programs or computers.

  • Dedicated server â€”> A Dedicated Server is a physical server where all the computing resources are exclusively allocated to a single user.

  • File server â€”> The file servers manage, serve, and secure files. A client can send and receive a file as a response.

  • Mail server â€”> A mail server is set up for mail management to send, receive, and store emails. There are two primary types of mail servers: IMAP and POP3 Servers. IMAP is quickly becoming the most popular server, allowing you to read your mail on multiple devices.

  • Proxy server â€”> A proxy server mediates between server-to-filter user requests and a client program. So, it allows the management of emails and shared connections.

  • Web server â€”> A web server is specifically designed to store and deliver web pages to users who request them. As a crucial element of the Internet infrastructure, its primary purpose is to host websites and various web applications.

Types of web servers

What are Web Servers?

A web server is a software application that serves clients' web pages and other web content upon request. It is responsible for receiving HTTP requests from clients (typically web browsers) and responding with the requested resources, such as HTML pages, images, CSS files, JavaScript files, etc.

When a client requests a web server, the server processes the request, retrieves the necessary resources from the file system or a database, and sends the response back to the client. This response typically includes the requested resource along with an appropriate HTTP status code (indicating the success or failure of the request), headers (providing additional information about the response), and any optional content.

Web servers are the backbone of the World Wide Web and play a crucial role in delivering web content across the Internet. They handle the communication between clients and web applications, ensuring the proper delivery and rendering of web pages.

Examples of popular web servers include Apache HTTP Server, Nginx, and Microsoft IIS (Internet Information Services).

It's important to note that a web server can also support additional functionalities, such as handling server-side scripting, authentication, session management, caching, load balancing, and more, depending on the specific server configuration and web application requirements.

How do web servers work?

Web server software is accessed through a website’s domain and ensures the delivery of the site's content to the requesting user.

The software aspect of a web server consists of multiple components, including at least an HTTP server. The HTTP server is capable of interpreting HTTP requests and understanding URLs. Also, as hardware, the web server stores web server software and other website-related files such as HTML documents, images, and other programming language files.

How web servers works

When a web browser needs a file hosted on a web server, it will send a request to the web server specifying the file's location using HTTP. When the web server receives the request, the HTTP server will accept and process the request and, lastly, send back a response to the web browser with the file or error (if not found) through the same HTTP connection.

To elaborate, when a browser makes a request for a page from a web server, the process involves a series of sequential steps:

First, a person will specify a web browser URL and send a request. The web browser will obtain the IP address of the domain name through DNS (Domain Name Service) or by checking its cache.

After obtaining the IP address, the browser will format the request into a proper HTTP request format understood by a web server, including all the headers and bodies, and lastly, it will send the request through HTTP.

The web server will process the request by validating and calling the appropriate web pages or API controllers in your remote computer to process the request and return an HTTP response to the web browser.

The web server will generate an error message if the requested page or endpoint does not exist or encounters an issue.

Lastly, the web browser will render and display the page or API data in JSON, XML, or GraphQL format.

Types of Web Servers

The types of web servers depend on the type of content and response they send back to the web server. If the content is dynamic, we categorize that web server as dynamic or static if otherwise.

  1. Static servers

  2. Dynamic servers

Static Servers

A static web server sends its hosted data as shown in your web browser. A static web server consists of a computer equipped with HTTP software. It is termed "static" because the server delivers hosted files to a browser exactly as they are, without any modification.

Dynamic Servers

A dynamic web server consists of a static web server plus extra software, most commonly an application server and a database. We call it “dynamic” because the application server updates the hosted files before sending them to your browser via the HTTP server.

The web server can generate content dynamically when requested from the database. Although this approach offers greater flexibility, its implementation is also more intricate.

Many web servers are available for different purposes created by companies such as Microsoft, Apache Software Foundation, or Sun Microsystems. Below are some of the common web servers:

  • Nginx. Nginx is a well-known open-source web server highly favored by administrators for its efficient resource usage and scalability. Its event-driven architecture enables it to handle numerous concurrent sessions adeptly. Additionally, Nginx is versatile and capable of functioning as a proxy server and load balancer.

  • Apache HTTP Server. This free and open-source web server is compatible with various operating systems, including Windows, Mac OS X, Unix, Linux, and Solaris. It is licensed under the Apache License, as the Apache Software Foundation developed it.

  • Microsoft Internet Information Services (IIS). It is a closed-source and private web server developed by Microsoft. It’s popular and widely used by Microsoft platforms and developers.

  • Sun Java System Web Server. Sun Microsystems offers a free Windows, Linux, and Unix web server. This web server is well-suited for managing medium to large websites efficiently.

  • Lighttpd. The FreeBSD operating system includes a free web server known for its speed, security, and low CPU power consumption.

I will explore one of the web servers in depth in this hub, but for now, let’s look at some web server security practices.

Web Server Security Practices

You can apply infinite best practices to your web server to make for a safer experience; most of these will depend on your use cases and what you want for your web server. However, below are a few examples of security practices that you can start with:

  • Incorporate a reverse proxy to conceal your internal server and function as an intermediary for incoming traffic from your internal server.

  • Implement access restrictions by employing rate limiting, restricting the web host's access to infrastructure machines, or utilizing a secure socket shell (SSH).

  • Continuously update and patch your web server to ensure it remains secure and protected against potential vulnerabilities.

  • Always monitor your network to make sure there isn’t any unauthorized activity.

  • Using a firewall and SSL as firewalls can monitor HTTP traffic, while having a Secure Sockets Layer (SSL) can help keep data secure.

I have already created an article exploring one web server to show you how to install, configure, and use a web server, which will aid you in building scalable backend systems. Click here to read how to install, configure, and use a web server.

That will be all for this one. See you on Saturday.

Don’t forget to check out the Mastering Backend Super Fan plan. It comes with unmatched benefits.

Weekly Backend Engineering Resources

That's all for this letter. See you next time, and stay safe!

It will help if you forward or share this email with your friends and leave a comment to let me know what you think. Also, if you've not subscribed yet, kindly subscribe below.

Connect with me
LinkedIn | Blog | Twitter | GitHub | YouTube

I moved my newsletter from Substack to Beehiiv, and it's been an amazing journey. Start yours here.

Reply

or to participate.