Web servers help your web application serve information to clients. You can run an application with Rails with just its default application server, but it will likely not do too well in a production environment with lots of users trying to use the application at the same time. 


There are three main web servers used for web applications today: Apache HTTP Server, Nginx, and IIS. Setting up servers like Nginx can also allow you to scale better when your application gets more users. For example, it can act as a load balancer that helps distribute traffic to different servers when one server becomes too overloaded with work. 

Brief note on scaling: 

There are two main types of scaling, scaling vertically and scaling horizontally. Scaling vertically in this context means adding more power to your machines (for example, more ram, cpu cores, etc). Scaling horizontally means adding more machine to help distribute the load. Scaling vertically can be very expensive at a certain point and may not yield as much performance/dollar when compared to horizontal scaling. 

Web servers can also help with configuring things such as SSL (the certificate that secures your website and gives it the HTTPS instead of HTTP in the URL). 

This article outlines in more detail on the difference between servers:

I would also recommend reading more about load balancer and reverse proxies since these topics come up pretty often when configuring production environments. You likely will not need to know about these when starting off, but it is good to know that they exist:

We will go over how to use Nginx with Ruby On Rails in the other articles so that you know how to monitor your application.


The next article can be found here. Previous article is here.