Web Backend Is Simplified

Web Backend Is Simplified

Before I started studying web development, I always had a huge concern in how the backend of web applications work.

·

3 min read

The web consists of two main parts: the frontend and the backend. The frontend which is known as the layer above the back end is concerned with website presentation and it includes all the software part of the user interface. On the other hand, the backend is all of the parts of the web that users do not see or directly interact with. By the end of the next few lines, we are going to learn how the backend of a website works. First of all, lets learn what the URL is. For instance, lets look at google URL which is google.com. A typical URL consists of four parts as it is shown in the figure mentioned below.

1.png

The server receives a request from a client in the form of a URL from which it gets most of the information needed to process this request. Each part of the URL has its own mission.

  • The protocol tells the server if the request is encrypted or not so it determines how data is transferred between the host and a web browser but it does not affect the way the server handles this request. The most common two protocols are HTTP which is for standard non-encrypted requests, and HTTPS which is for encrypted requests.
  • The host determines to which server the response of our request will be sent. Each server has its own special host and all requests for the server will have the same host. Consequently, google.com for instance is the host for Google server, so all the requests assigned to Google server will have its host which is google.com. Let’s move to the more important parts: the path and the query string.
  • Each server consists of several different sections. Consequently, the path determines which section of code on the server should be run in order to get the required response so the path tells the server what the client wants from it.
  • The query string consists of particular query parameters that enhance the way the server responds to a request for a specific path so Google uses the same path every time we search for something however the query string with its particular parameter ask the server to respond with exactly what we search for.

Essentially the server needs one more thing to function properly in addition to the URL. This one more thing is called the action. The action can be GET, POST, PUT, or DELETE. Therefore, here is the complete scenario, the URL tells the server which section to find and how to alter it according to the query parameters however this section consists of several different parts so the action is needed to determine which the exact part of that section should be run by the server.

According the above-mentioned scenario, Google search page shows the same thing all the time because it has the same path and the same action however the search results for any topic are different due to the different query parameter that is used in this particular search.