System Design Fundamentals: Client -Server Model
The client-server modal is one of the fundamental concepts of system design. It's simple and relatively straightforward. let me explain you in a simple term.
Client: A machine or process that requests data from a server/machine.
Server: A machine or process that listens to the client's request and responds back with some data or information.
yes, it is simple as that. Let me provide a diagram to analyze it visually.
Let me walk you through the brief interaction process between the client and server.
Let's start with typing the URL of the website in the browser. suppose “https://www.facebook.com‘ in the client browser. Initially, the client has no idea about the Facebook server address. So client did a DNS request to get the IP address of the server.
DNS request is a special kind of request to the DNS server that returns the IP address of the server. we can think IP address of a machine is similar as house address in real world
Client gets the server's IP address and sends a request to it. The request payload also contains a source destination address so the server can send back its data to the source destination.
Server can listen to requests in a specific port. we can think, of the ip address as a mailbox of an apartment and the port as an apartment number where we can directly deliver the mail. Let me explain entire concept by providing a diagram.
If you are looking for a definition, let me provide you with the same
IP ADDRESS: An address given to each machine connected to the public internet. IPv4 addresses consist of four numbers separated by dots: a.b.c.d where all four numbers are between 0 and 255. Special values include:
127.0.0.1: Your own local machine. Also referred to as localhost.
192.168.x.y: Your private network. For instance, your machine and all machines on your private wifi network will usually have the 192.168 prefix.
PORT: In order for multiple programs to listen for new network connections on the same machine without colliding, they pick a port to listen on. A port is an integer between 0 and 65,535 (216 ports total).
Typically, ports 0–1023 are reserved for system ports (also called well-known ports) and shouldn’t be used by user-level processes. Certain ports have pre-defined uses, and although you usually won’t be required to have them memorized, they can sometimes come in handy. Below are some examples:
22: Secure Shell
53: DNS lookup
80: HTTP
443: HTTPS
DNS: Short for Domain Name System, it describes the entities and protocols involved in the translation from domain names to IP Addresses. Typically, machines make a DNS query to a well known entity which is responsible for returning the IP address (or multiple ones) of the requested domain name in the response.
I think, I am able to explain the concepts, if not, I am always happy to discuss them. we can connect via LinkedIn and have some great discussions related to tech
And if you are interested to learn end to end System Design concepts, check out the amazing course by iNeuron