The Journey To A Website

SpaceXEngineer
Aug 9, 2017 · 5 min read

Suppose someone wants to access https://www.holbertonschool.com from their browser…well there is a lot of stuff that happens from the moment that person presses enter and lands on the Holberton School home page. This post will briefly cover some of things that go on during that “journey”. While I’ll mention various things along the journey, I’ll keep it general and avoid specific details since one can go down a rabbit hole with the details that surround the full stack concepts involved. This post will cover:

  • DNS request
  • TCP/IP
  • Firewall
  • HTTPS/SSL
  • Load-balancer
  • Web server
  • Application server
  • Database

DNS Requests

https://www.holbertonschool.com is a domain name that associated with IP address. In the Internet, domain names are linked with IP address through DNS, which stands for Domain Name System.

https://www.holbertonschool.com may have the IP (internet protocol) address 134.23.23.45 and if that IP address used, the home page is reached as well. However, most IP address are not human readable, therefore DNS solves this challenge by handling the work of translating domain names into IP addresses that are to be handled by servers.

When https://www.holbertonschool.com is entered the browser and OS (operating system) checks for the IP address in the cache (memory). If the site has been visited before and is in memory, that is it! The site’s page will be brought up from memory and the journey will be complete.

If Not in Memory…The Journey Continues — TCP/IP

If the site’s information domain name and IP are not stored in memory then the request to reach that site enters the Internet. A request to reach the site is sent out via TCP/IP (Transmission Control Protocol / Internet Protocol) to ISPs (Internet Service Providers). Note, while there are other protocols that may be used, TCP/IP is the most commonly used method since there is a lower risk of errors and/or interruptions. TCP is commonly used with IP since TCP delivers a request and IP obtains the address for that request. An ISP will route the request to the datacenter where the server(s) where information for the Holberton School site can be reach.

Servers!

Somewhere miles is a datacenter that has thousands of servers racked up and somewhere Holberton School is paying to use some of these servers to store and retrieve its information for the world. Eventually (in a matter of milliseconds) a request to reach its site makes its way to a server that can be physical or even virtual (in this case we will assume it is virtual) that has Holbertons site information on it, but there are some securities measures that occur beforehand…

Firewall

A firewall is a system that monitors incoming and outgoing information and can block information based on how the firewall is configured. As a safety measure, all servers may have firewalls to prevent malicious content and/or the spread of viruses that can bring a system down. In the diagram below you can see that firewalls have been added over servers to depict a simple representation.

HTTPS/SSL

HTTPS (HyperText Transfer Protocol Secure) is protocol involved with transferring data between a browser and server in secure, encrypted way. SSL (Secure Sockets Layer) certificate initiates secure sessions. This adds a level of secure help make sure every interaction occurs in an encrypted manner. With the information sent (and received) encrypted and acceptable for the firewall, the request has entered its first server!

Load-balancer

A load-balancer is a device that handles traffic across network servers and effectively makes use of algorithms to make the most efficient use out of the resources that are available. An example may be distributing workload 50% to 50% across 2 servers where both are in active states to handle traffic (as shown in the diagram). Typically a load-balancer can be integrated with a virtual server such as Linux and may also be configured into cluster for redundancy measures for safety purposes in case one or more load balancers go down. HAProxy is commonly used open-source load balancer and is used as an example in the diagram below. Once a request pings a load-balancer, the next step involves a web server!

Web Server

A web server is a program that handles files that come together to form a web page. A few web server programs that are popular include Apache and Nginx. Nginx is used as an example and accesses static content in the codebase such as HTML, CSS and media. However, if there is a dynamic content, the journey continues to an application server!

Application Server

This is effectively the server that executes dynamic content in the codebase such as Python, Ruby, Javascript, etc. Gunicorn is an example application server program for executing Python. Depending on the request(s), it may also initiate interaction with a database dependent on the request. Thus that brings the request to final endpoint before heading back!

Database

A database is where data is simply stored. This can range from usernames, passwords, emails, etc. If someone wanted to login into their profile and continue their application, this is where their information would be stored! An example of database program that can be used is mySQL. As the diagram shows there are two identical server configurations and so a back database is covered which is crucial measure it maintaining a site.

That’s it! For the most part on a high level, the request to https://www.holbertonschool.com has been achieved the sites homepage is generated on screen. Again, this post has covered most of the things that happen from a basic viewpoint. On the other, there are many others that have been answering this question and continue to provide insight into the whole process. A common interview question involves answering what happens when google.com is entered. A more comprehensive answer to this famous question has been contributed by many others at https://github.com/alex/what-happens-when#the-g-key-is-pressed.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade