Introduction
Who doesn’t love eating out?
I’m pretty sure almost everyone does, so let us consider we’ve gone to McDonald’s. There, we place our order at the counter and wait for it to be served to us.
Servers and clients work in a similar manner. A client initiates a request for services, and a server provides it. Thus, an analogy can be drawn between a customer placing an order at McDonald’s and a client requesting a service from a server.
Now, at McDonald’s, we only place the order while the staff carries it out. So, there is a division in the tasks. This gives rise to a network of different people involved.
Similarly, when a client makes a request, both the client and the server have different tasks where the server uses different programs to carry out a request. This is called a client-server model or client-server architecture.
Next, while placing an order at McDonald’s, we will communicate either in English or the local language.
In servers and clients, communicate using the TCP/IP protocol suite.
Source: Omnisci
So far, we have just learnt what servers and clients are, but there’s a lot more than just their definition. In the subsequent sections of this article, we’ll learn the rest.
Categories of Client-Server Models
Servers and clients can be of four different categories depending on the divisions in the tasks.
One-Tier Architecture
This consists of a simple program running on a single computer without having to access the network.
To understand this, let’s take the example of a person living alone. If they want to have a burger, they will make it for themselves without requesting anyone else.
Two-Tier Architecture
This consists of a client, a server and a protocol linking the two.
An example to understand this would be a person placing an order at McDonald’s. The person is the client, and McDonald’s is the server that is fulfiling the client’s request.
Three-Tier Architecture
This architecture has three layers - the client layer with the UI (presentation tier), the service layer, which processes a client’s requests (application tier) and the database server that stores information (data tier).
Let us consider a practical example to understand this architecture. Suppose we place an order at McDonald’s using an online food delivery service like Swiggy. Here, we are the client present in the client layer, Swiggy is in the service layer and processes our request, while McDonald’s is the server providing us (the client) the food (for a computer system data).
N-Tier Architecture
To understand this, suppose you wish to have a burger from McDonald’s, and you tell your mother that. She tells your father, who then sends your brother to McDonald’s. Thus, your request is fulfilled but through N number of people.
N-tier architecture is similar to such a scenario where an application is divided into logical layers, with separate responsibilities and manage dependencies, and physical tiers, which run on separate machines.
Now that we know a bit more about servers and clients let’s learn how they work.