Client-Server Communication Model

A Pattern Behind Nearly All Networked Software

The client-server model describes a simple division of roles: a server offers a service and waits for requests, while a client initiates requests to make use of that service. This pattern, at its core, underlies the vast majority of networked applications.

The Server's Role

  • Runs continuously, waiting (listening) for incoming requests.
  • Can typically handle requests from many different clients at once.
  • Owns and manages the actual resource or service being provided - a database, a set of files, a game's shared state.

The Client's Role

  • Initiates the connection or request whenever it needs something.
  • Typically doesn't need to be constantly available - it only exists to make requests when the user actually wants something.
  • Depends entirely on the server actually being available to respond.

A Simple Request-Response Exchange

Client ---- "Give me the current weather for London" ---->  Server
Client <----------- "18°C, cloudy" ------------------------  Server

Why One Server Can Serve Many Clients

A single web server, for example, simultaneously handles requests from potentially millions of different browsers around the world - each client's request is handled independently, generally without needing to know anything about any other client currently connected to that same server.

A Contrasting Model: Peer-to-Peer

Not every networked application follows this model - peer-to-peer systems instead let every participant act as both a client and a server simultaneously, without one single, centralized, always-available server - a fundamentally different architecture built for a different set of trade-offs.

Written by Lorens Mishra

Software Engineer Notes Management System Administrator

Discussion

0 comments
Sign in to join the discussion.

No comments yet. Be the first to say something.