DEV Community

Cover image for Networking Basics: Client-Server Model
Naym Hossen
Naym Hossen

Posted on

Networking Basics: Client-Server Model

Networking Basics: Client-Server Model

Client-Server Model

Imagine you went to the grocery store to do your weekly shopping.

You walked in and told the shopkeeper your shopping list — "give me these items." The shopkeeper heard your order and told his staff to go pull those items. The store worker took your list, gathered everything, and brought it back to the counter, and the shopkeeper handed it over to you.

Notice that two separate tasks are happening here —

  1. You walk in with your list and place an order, but you don't prepare the product yourself (Request)
  2. The store staff gathers the items based on your order and hands them to you (Response)

In the basics of networking, this is exactly the Client-Server Model. You are the Client, and the shopkeeper who got your items ready is the Server.

How does this work technically in a software system?

  • Client = your phone/browser/app — it sends the request
  • Server = a powerful computer — it receives your request, processes the data, and sends it back to you

The Client never processes data on its own — just like you don't pull items off the shelf yourself at the store. You just place your order based on what you need, and they prepare and serve it to you.

The Request-Response cycle completes over a long chain of steps

Many of us use the Instagram app. So what actually happens behind the scenes when you open the Instagram app?

  1. You, the Client, open the Instagram app
  2. The app immediately sends a request to the server — "this user has opened the app, give me the feed content this user should see"
  3. The server receives your request
  4. The server doesn't hold anything on its own — it acts like a middleman, going to the database and asking, "what kind of posts does this person like, who do they follow? What are their new posts?"
  5. The database hears the server's request and returns the data
  6. The server doesn't just pass the raw data along — it processes it and builds a clean response in JSON format, then sends it to the Client
  7. This response reaches your app
  8. The app then beautifully displays it as a visual on your mobile screen

Such a long process — yet it shows up the instant you open your phone! Usually this entire task is completed in a few hundred milliseconds — so fast that we don't even realize how many steps this content passed through before appearing on our screen.

(Note: behind this fast response, there are more advanced topics like Caching involved — I'll write about those in the next post.)

A "server" doesn't just mean a single computer

In System Design, "server" doesn't mean just one computer. In a large product like Instagram, servers are handled like a team —

  • One server only handles authentication
  • One server handles the feed content
  • Another server handles storing/serving the feed's files

(How multiple servers work together — we'll learn that in detail in the next phases, with Load Balancers, Microservices, and so on.)

Why the Client-Server Model matters (for System Design)

Understanding this model is essential, because all of System Design essentially revolves around one question —

"How can the process of data moving from Client to Server, and back from Server to Client, be made faster, more reliable, and more scalable?"

Load Balancers, Caching, CDN, Database Replication — all of these are really just different strategies for optimizing this one cycle.

Top comments (0)