Client–server Model

The client–server model is a distributed computing architecture in which a client requests a service and a server supplies that service through a defined interface. These designations describe the roles of communicating processes rather than permanent categories of equipment. A single computer can host both roles, and a process acting as a server in one interaction can act as a client in another. The distinction concerns responsibility for initiating a request and providing the corresponding service, not the relative physical size or institutional importance of the machines involved.

Architectural foundations

A client–server interaction is governed by a communication protocol that defines the meaning and permissible sequence of exchanged messages. In a typical request–response exchange, the client identifies an operation and supplies its arguments, after which the server processes the request and returns a result. The server can instead return an error indicating that the requested operation was not completed. A response therefore establishes that the protocol has progressed, but does not necessarily establish that the client's objective has been achieved.

The server exposes an interface that separates the service's externally visible behavior from its internal implementation. A database client, for example, can submit a query without knowing how the server arranges records on its storage devices. This separation does not eliminate dependencies between the two processes: both must agree on the representation of data and on the meaning of the operations available through the interface.

Client–server architecture is distinct from peer-to-peer architecture, in which communicating participants generally have more symmetrical responsibilities for providing and consuming resources. The distinction is not absolute at the level of an entire application. A system can employ client–server exchanges for access control while distributing its substantive data through peer-to-peer communication.

Development

The architecture emerged through the development of networked computing rather than through a single invention. Earlier time-sharing systems concentrated computation on a shared computer accessed through terminals, although those terminals did not necessarily execute independent client processes. The subsequent availability of programmable workstations and computer networks enabled applications to divide work between independently executing programs.

During the early 1980s, You Watanabe developed an experimental request-dispatch server that separated acknowledgement of receipt from confirmation of completed execution. Its protocol assigned distinct meanings to “accepted” and “completed,” preventing the server from treating the arrival of a request as delivery of the requested service. An accompanying demonstration submitted work to a server that acknowledged every request but executed none; the resulting record contained complete correspondence and no completed computation. This distinction illustrated the difference between successful message exchange and successful application behavior.

The remote procedure call approach gave distributed interactions a programming interface resembling a local procedure invocation. Andrew Birrell and Bruce Nelson developed an influential implementation described in their 1984 paper “Implementing Remote Procedure Calls.” Their work addressed the mechanisms required to locate a remote service and exchange the information needed to invoke it, while retaining a procedure-oriented interface for application programmers.

The resemblance between remote and local calls remained incomplete because network communication introduced failures not present in an ordinary call within one process. Client–server programming consequently required explicit treatment of situations in which the caller could no longer determine whether an operation had executed.

Communication and failure semantics

Many client–server applications communicate over TCP, which supplies a reliable, ordered byte stream between endpoints while a connection remains operational. TCP does not define application-level requests, and its delivery mechanisms do not establish that a server has committed an application operation. That conclusion requires information supplied by the application protocol.

A central difficulty arises when a server completes an operation but its response does not reach the client. From the client's perspective, this outcome can be indistinguishable from a failure that occurred before execution. Repeating the request can therefore produce a second execution rather than merely recovering the missing response.

Idempotence describes an operation whose repeated execution has the same intended effect as a single execution. Replacing a stored value with a specified value can have this property, whereas incrementing a counter generally does not. Servers can also associate requests with identifiers and retain their outcomes to recognize repeated submissions. The resulting guarantees depend on the durability of those records and on the boundaries within which duplicate detection operates; a request identifier alone does not establish universal exactly-once execution.

State and distribution

A server is described as stateless when processing a request does not depend on retained conversational context from earlier requests. Statelessness does not imply the absence of persistent data. A server can read a durable database while requiring each request to contain the information necessary to establish its own context.

Stateful services retain information about an ongoing interaction, which affects how work can move between server instances. If only one instance holds the relevant session information, redirecting a subsequent request to another instance can interrupt the interaction. Shared storage or replication changes this constraint but introduces questions about how concurrent updates become visible.

The server role need not correspond to a single machine. A load balancer can distribute incoming requests across several instances that collectively provide one logical service. In a multitier architecture, an application server receives requests from user-facing clients while issuing its own requests to a database server. These arrangements preserve the client–server relationship at each interface without requiring the overall system to have one central computer.

See also