Understanding Client-Server Model

Dishant Tanwar
4 min readMar 19, 2021

I love explaining the working of the client-server model to my fellow mates and friends because it’s a perfect example of how common logic is used to create such a modern model which can be thought of as a divide and conquer technique.

In this article, we are going to understand how the servers, clients, and databases interact.

And I’m sure after going through this article you’ll have enough understanding of the whole Client-Server model that you’ll love explaining it to others as well.

Let’s get started,

Main Vocab :

  • hosts: computers connected over a network (ex. internet).
  • server: A centralized system that communicates over a network to serve many clients.
  • client: A program that can request data from a server.
  • communication protocol: A common language used by the client and server to communicate with each other.

Other things to be aware of are request and response. Let’s understand them with an example:
Let’s suppose we went to the H&M website to get a white coolmax t-shirt. As there are thousands of products how will the browser (client) tackle the situation of handling details of thousands of products and getting is what we want?
As smart learners, we know the answer the browser (client) will ask the website (server) to only send us details of products we’re interested in which in our case is t-shirt.

This process will work like this:

Step 1: Our computer (user client) will send a request to the H&M website (web-server) which runs on a host or computer to get details of our white coolmax t-shirt. It will be a GET request (as the name suggests it’s a request type to get some response data).

Step 2: The website (web-server) will process the request and generate another request to the Database server to get t-shirt data stored in the H&M database.

Step 3: Now as per the request from the website or webserver the Database will query the database and will return a response to the website (web-server) with the requested data ie. details of our coolmax white t-shirt.

Step 4: Our website or web-server has got the details of our t-shirt from the response of Database-server. Since the webserver now has all the details requested by our user client or browser it will return a response to the user-client or browser containing the details of our t-shirt.

Final: The user client (browser) has now got the details it requested from the web server and now the browser can show the details of our t-shirt to us on our screen.

The user-client (browser) showing the details that we requested from our backend (web server and database server) using a GET request.

Other Details:

  • The host or computers that send a request are called clients while the host or computers that respond to requests by response are known as servers.
  • Here in our case, the web server is playing the role of both the server and the client. In step 1 and step 4 when it is receiving a request from a user client it is acting as a server while in step 2 and step 3 when it is requesting data from the database server and getting a response it is acting as a client.
  • Both client and server run on a host.
  • More than one client can make a request to the same server and many servers can access the same database server as the database server treats the web server as a client.

Summary

The fundamental concept of Client Server Model is that when the client sends a request to the server. The server sends a response to the client.
In most cases we’ve a user client who makes request to a web server, who makes a request to the database server and when the database server give response to web server the web server gives response to the user client. And finally the user client displays the information to the user.

Note from the author:
I am sure this article played its reason by helping you to get a clear high-level idea around the working of the client-server model. I am looking forward to writing more simple and interesting articles on various topics that will help you become a better engineer. You can subscribe so that I’ll be able to share my expertise with you.
Thank you, learners.

--

--

Dishant Tanwar

A full-stack developer with a love for Data Science as well. And a huge Manchester United fan.