Question 2 of 15 · CIE-1 QB · 7 marks
Open in ChatGPTExplain the roles and characteristics of clients and servers in Distributed Systems.
Introduction
The client-server model is the base architectural style of nearly every distributed application. One process (the client) asks for a service, another process (the server) provides it, and the interaction is a request followed by a reply.
Client characteristics
- Initiates the interaction. The client always sends the request first; the server does not address the client until a request arrives.
- Depends on the service. It owns few resources and relies on the server for data or computation.
- Waits for a reply (synchronous) or continues and collects the reply later (asynchronous), for example a browser fetching a page or a mail client collecting email.
- Short-lived: it connects, gets the result and may disconnect.
Server characteristics
- Passive and always listening. It waits on a known port for requests, and never initiates contact by itself.
- Concurrent. An iterative server handles one request at a time; a concurrent server runs a thread or process per request so that a slow client cannot block others.
- Long-lived and authoritative. It holds the shared resource (database, files, user records) and is the single source of truth on it.
- Stateless or stateful. A stateless server keeps no record between requests (HTTP); a stateful server keeps client context (FTP control connection).
Diagram
Interaction styles
| Style | Description | Example |
|---|---|---|
| Connectionless | One datagram per request and reply, no setup | DNS over UDP, HTTP over UDP (HTTP/3) |
| Connection-oriented | A connection is set up and held for the session | HTTP/1.1 over TCP, SSH |
| Blocking | Client blocks until the reply arrives | Remote procedure call |
| Non-blocking | Client continues and collects the result later | Asynchronous HTTP, message queues |
Example
- A web browser (client) sends
GET /result.pdfto the university portal. - The web server (server) authenticates the session and runs a separate thread for the request.
- It reads the file and returns it.
- Other students' requests are served by other threads during the same interval.
Conclusion
The client stays thin and initiates; the server owns the resources and serves concurrently. This asymmetry is what makes it possible to have one authoritative copy of data and many independent users of it.