The client–server model is a form of software architecture in which one component, the client, requests a service and another, the server, provides it. The components communicate through an agreed protocol, usually across a network, although they may also run on the same machine. Familiar examples include a browser retrieving a web page, a mobile application querying an account service, and a desktop program submitting a database query. “Client” and “server” describe roles in an interaction, not necessarily distinct kinds of hardware.
The model separates the use of a resource from its management. A server can maintain shared data, enforce access rules, or perform specialized computation for many clients, while each client handles its own interface and some local processing. This division underlies much of the Internet, enterprise computing, and cloud computing. It also creates characteristic engineering problems: communication takes time, requests may fail independently of their execution, shared resources can become overloaded, and the parties must agree on both message formats and operational meaning.
Client–server systems range from a single application connected to one server to globally distributed services containing thousands of cooperating processes. Their behavior depends not only on the division between client and server, but also on protocol design, placement of application state, concurrency control, replication, failure handling, and security boundaries.
Roles, boundaries, and interaction patterns
A client initiates an application-level interaction to obtain data or request an operation. A server makes a service available and processes requests according to its interface. In a conventional network service, the server listens at a known or discoverable endpoint, and the client establishes communication with that endpoint. The endpoint may be identified by a host name and port number rather than by a permanent physical machine. A service name can therefore remain stable while the computers implementing it change.
The distinction is logical rather than physical. A database management system can act as a server for an application, while that application acts as a server for a browser. A single process can serve incoming requests and issue outgoing requests during their execution. Likewise, a laptop can host a development server while running its client locally. Communication through a local socket or another interprocess mechanism preserves the same division of responsibilities without requiring traffic to cross a physical network.
The simplest interaction is request–response: a client sends a request, the server performs an operation, and the server returns a result or an error. The relationship does not require every message to follow this pattern. Servers can stream data, send notifications over an established channel, or maintain long-running exchanges. A chat service, for example, may accept a client connection and subsequently deliver messages whenever other users send them. The server’s ability to initiate a message within that connection does not by itself turn the architecture into peer-to-peer networking.
A client–server boundary normally defines responsibilities for naming, validation, access control, and resource ownership. A file server controls stored files; a client requests operations on them. A rendering service controls a pool of specialized processors; clients submit jobs. These arrangements allow heterogeneous clients to use the same underlying resource, provided that they implement the service contract. An application programming interface specifies which operations are available, what inputs they accept, and what responses they produce.
Client–server architecture should not be equated with a single central computer. A logically unified service may be implemented by many replicated or partitioned servers. Conversely, a system containing many computers is not necessarily client–server: participants may exchange resources symmetrically, as in some peer-to-peer systems. The defining issue is the assignment of service-requesting and service-providing roles, not the number or geographic location of machines.
Historical development
Client–server computing developed from several earlier forms of resource sharing rather than from one invention. During the 1960s, time-sharing systems allowed multiple users to interact with a central computer through terminals. These systems established important practices of shared access, user identification, and centralized administration. A simple terminal, however, generally contributed little independent application processing. Later client–server systems increasingly divided computation between independently programmable machines instead of treating the user device mainly as an input and output peripheral.
Packet-switched networks and local-area networking made remote services practical. ARPANET began operation in 1969, and early network applications supported remote login and file transfer between distinct hosts. At Xerox PARC, work on Ethernet began in 1973 and helped establish an environment in which personal workstations could use shared network resources. Printing and file storage were especially suitable services: expensive or centrally managed equipment could be shared without requiring every workstation to contain an equivalent local resource.
During the 1980s, workstations and personal computers became capable application platforms, while organizational networks made shared database and file services increasingly accessible. Applications could run their interfaces on users’ machines and send queries to a database server. Instead of transferring entire files for local processing, a database client could ask the server to select and update records near the stored data. This reduced some forms of network traffic and concentrated concurrency control in the database system.
Programming techniques also made network services easier to build. Andrew Birrell and Bruce Nelson’s 1984 paper “Implementing Remote Procedure Calls” described an influential approach to remote procedure calls, in which a program invokes an operation implemented in another process through generated or handwritten communication machinery. Such techniques offered a procedure-like interface to remote services, although network failures and partial execution remained fundamentally different from ordinary local function calls.
The World Wide Web greatly broadened the model’s reach. Tim Berners-Lee proposed the Web at CERN in 1989, and the first web browser and server were implemented in 1990. Standardized resource identifiers, document formats, and transfer protocols allowed independently developed clients and servers to interoperate. In the 1990s, web applications increasingly placed business logic behind web servers rather than distributing a separate native application to every user.
Subsequent developments changed deployment more than the underlying roles. Virtual machines, containers, managed databases, and cloud platforms made it possible to allocate service capacity dynamically. Software as a service delivered centrally operated applications through network clients, while smartphones introduced large populations of mobile clients with intermittent connectivity. These systems retained the client–server relationship while distributing its implementation across more layers and locations.
Protocols and request execution
A working client–server exchange requires agreement at several levels. The parties need a way to locate one another, transport messages, identify message boundaries, encode values, and interpret operations. A client might resolve a host name through the Domain Name System, establish a transport connection, negotiate security, and then send an application request. These steps belong to different protocol layers and can fail independently. Successful name resolution, for example, does not imply that the application server is reachable or willing to accept work.
The Transmission Control Protocol provides an ordered byte stream rather than a sequence of application messages. An application protocol using it must therefore define message framing: a fixed size, a length field, delimiters, or another rule for determining where each message ends. Protocols based on datagrams face different concerns, including message size and delivery behavior. QUIC provides secure, multiplexed streams over UDP and is used by HTTP/3. The choice of transport influences connection setup, loss recovery, and how simultaneous exchanges affect one another.
The Hypertext Transfer Protocol illustrates the separation between transport and application semantics. An HTTP request identifies a method, a target resource, and associated fields, optionally followed by content. The response carries a status code, fields, and possibly content. A status such as 404 indicates an application-level result, not a failure of the network to deliver bytes. HTTP also defines caching and intermediary behavior, allowing a request to be handled by components other than the resource’s origin server.
Message representation is another independent choice. A service may exchange JSON, XML, or a binary format such as Protocol Buffers. Representation determines how values are encoded, but not by itself what an operation means. A field containing an integer could represent a quantity, an identifier, or an amount in a specified currency unit. Interoperability consequently depends on semantic definitions, including units, allowed ranges, treatment of missing values, and compatibility rules for future versions.
A typical server receives and parses a request, authenticates the caller where required, validates the operation, schedules work, accesses resources, and encodes a response. Implementation strategies vary. A process-per-connection design isolates connections but can incur substantial overhead; thread pools bound the number of worker threads; event-driven implementations allow many connections to share a smaller number of execution threads. Asynchronous programming helps avoid blocking a worker while it waits for storage or another service, but it does not eliminate the underlying processing cost.
Connection lifetime and request lifetime need not match. Several requests may reuse one connection, and multiplexed protocols may carry concurrent exchanges over it. Timeouts, cancellation messages, and request identifiers help manage these exchanges, but cancellation is not necessarily proof that server-side work stopped. A result may have been committed immediately before the cancellation arrived.
Two-tier, three-tier, and service-based architectures
In a two-tier system, clients communicate directly with a service that combines important backend responsibilities, commonly a database server. A desktop application might display forms, validate inputs, construct SQL statements, and send them directly to a relational database. This arrangement can be straightforward within a controlled environment. It also places substantial application logic and database connectivity on client machines, making coordinated upgrades and credential management more difficult as the client population grows.
Three-tier architecture separates presentation, application logic, and data management. The client handles presentation; an application server implements business operations; and a database server stores persistent records. For example, a purchase request can reach an application server that checks inventory rules and creates an order through the database. The browser does not require direct database access or knowledge of the database’s internal tables. This separation allows changes to the data schema to be mediated by a comparatively stable application interface.
A tier is a logical responsibility, whereas a deployment node is a physical or virtual execution location. Three logical tiers can run on one computer during development, and a single application tier can span hundreds of machines in production. Confusing these meanings obscures both performance and security analysis. A call between two modules in the same process has different costs and failure modes from a call across a network, even if an architectural diagram draws both as identical arrows.
Larger systems often divide the application tier into specialized services. In a microservices architecture, services may own separate data and expose independently managed interfaces. An order service can become a client of inventory, payment, and delivery services while remaining a server to the user-facing application. The benefit is not simply “more servers”: it is a different allocation of ownership, deployment boundaries, and operational responsibilities. The cost includes additional communication, interface compatibility requirements, and failures that can occur between stages of one user operation.
Intermediaries further complicate the apparent client–server pair. A reverse proxy accepts requests on behalf of backend servers and may terminate secure connections, route requests, compress responses, or enforce limits. An application gateway may translate an external interface into several internal calls. A cache can answer a request without consulting the origin service. These intermediaries act as servers toward upstream clients and as clients toward downstream services.
Not every interaction needs an immediate response. A service may place work in a message broker and return an acknowledgment before processing finishes. Workers later consume the message and record the result. This changes the application contract: acknowledgment may mean “accepted for processing,” not “completed successfully.” The client–server model remains useful, but it describes only part of a larger workflow containing queues, notifications, and independently scheduled consumers.
State, sessions, and consistency
Application state includes information that must survive between operations: account records, shopping carts, permissions, open transactions, or the progress of a workflow. A crucial distinction is between persistent resource state and conversational state retained for a particular client. A server can be stateless with respect to client sessions while still using a large persistent database. “Stateless” therefore does not mean that the system stores no information; it usually means that each request contains enough context to be processed without relying on a particular server instance’s memory of earlier requests.
A stateful server may retain an authenticated session, an open file handle, or a transaction context. This can reduce repeated setup and support interactions that naturally extend over time. It also ties subsequent operations to retained state. If that state exists only in one process, a restart loses it, and routing a later request to another process may fail. Systems address this through shared session stores, replicated state, or session affinity, which preferentially directs one client’s requests to the same backend. Affinity improves locality but does not by itself preserve state after failure.
A browser commonly sends an HTTP cookie containing a session identifier. The server uses that identifier to retrieve session information rather than embedding the full session in every request. Other designs place claims in a protected token that the server verifies. These approaches trade storage lookups against token size, expiration behavior, and revocation complexity. A signed token can establish that its contents were issued by a trusted party, but it does not automatically establish that the associated permission remains valid at the time of use.
Shared data also raises consistency questions. If two clients attempt to reserve the last available item, separate read-then-write sequences can both appear to succeed unless the service coordinates the updates. A database transaction groups operations under defined guarantees, and concurrency-control mechanisms determine how simultaneous transactions interact. Optimistic approaches detect conflicts before committing; locking approaches restrict conflicting access while operations are in progress. Application-level rules may require additional constraints, such as a unique reservation identifier.
Replication introduces another dimension. A client that writes to one replica and reads from another may observe an older value if replication is asynchronous. Systems can offer guarantees such as reading one’s own writes or route particular reads to a sufficiently current replica. Stronger coordination can simplify application behavior but may add latency or reduce availability during communication failures. The CAP theorem concerns the incompatibility of particular consistency and availability guarantees during a network partition; it is not a general rule that every system always chooses any two of three equally independent features.
State management must also distinguish storage durability from client knowledge. A server may commit an update and then lose its connection before the acknowledgment reaches the client. The client’s uncertainty concerns the outcome of the request, even though the database itself has a definite state. Reliable interfaces provide ways to identify the operation and discover or safely repeat its result.
Performance, capacity, and scaling
Client–server performance depends on both communication and service execution. A simplified request latency can be expressed as
where network time includes relevant communication delays, queue time is the wait before work begins, and service time covers processing and dependent operations. Real requests may involve several network exchanges or parallel dependencies, so this expression is an accounting model rather than a universal execution formula. It nevertheless distinguishes slow computation from waiting caused by congestion or distance.
Latency and throughput measure different properties. Latency is the duration of an individual operation; throughput is the number of operations completed per unit time. Increasing concurrent requests can improve resource utilization until a bottleneck saturates. Beyond that point, additional concurrency often increases queues rather than completed work. Little’s law describes a stable system as
where is the average number of requests in the system, is the average throughput, and is average time in the system. A service completing 1,000 requests per second with an average residence time of 0.2 seconds has, on average, 200 requests in progress or waiting.
Vertical scaling increases the resources of an individual server, such as processor capacity, memory, or storage bandwidth. Horizontal scaling adds server instances and distributes work among them. A load balancer may route connections or individual requests using round-robin selection, observed load, locality, or other policies. Horizontal scaling works most directly when requests can be handled independently; shared locks, centralized metadata, or a single overloaded database can remain bottlenecks even after many application servers are added.
Caching avoids repeated work by retaining previously computed or retrieved results. Browser caches, proxy caches, application caches, and database buffer pools operate at different boundaries. Each requires a rule for deciding whether a stored result remains usable. A cached public image may be shared among many clients, whereas an account page generally requires access-sensitive handling. Cache invalidation is particularly difficult when several services can modify the underlying data or when a response depends on attributes not included in the cache key.
Batching and connection reuse reduce per-operation overhead. Fetching several records in one operation may avoid repeated round trips, but oversized batches can increase memory use and delay smaller requests. Compression reduces transferred bytes at the cost of computation. Moving computation closer to data can avoid large transfers, while placing servers nearer users reduces propagation delay. These techniques optimize different terms in the latency budget and can work against one another.
Capacity planning also examines latency distributions rather than averages alone. A small fraction of slow requests can dominate user-visible behavior when one operation depends on many services. Systems therefore measure high percentiles, dependency timing, saturation, and error rates. Resource limits and admission controls prevent excessive accepted work from turning a localized capacity problem into prolonged overload.
Partial failure and reliable execution
Client–server systems are subject to partial failure: one component can fail while others continue operating. A client may remain healthy while its server crashes, or both may remain healthy while their network path fails. Distributed computing must account for these possibilities because an absent response does not identify its cause. A timeout establishes that an operation did not finish within a chosen interval from the observer’s perspective; it does not prove that the server never received or executed it.
Retries improve resilience to transient failures but can duplicate effects. If a client submits a payment request, loses the response, and submits it again, a naïve server may process two payments. An idempotent operation has the same intended effect when repeated as when performed once. Setting an object’s status to a specified value can be idempotent; incrementing a counter generally is not. Even an idempotent operation may produce a different response on repetition because the surrounding state has changed.
For non-idempotent operations, interfaces can accept a unique operation identifier or idempotency key. The server records that identifier together with the operation’s outcome and recognizes later submissions of the same logical request. Correct implementation requires coordinating the duplicate-detection record with the business effect. If the effect is committed but the record is lost, or vice versa, duplication or omission remains possible. Retention periods and the scope of identifier uniqueness also form part of the contract.
Delivery guarantees require similarly precise interpretation. “At most once” can avoid repeated handling while allowing an operation to be lost. “At least once” favors eventual handling but permits duplicates. Claims of “exactly once” generally apply within a defined transactional or deduplication boundary, not to every physical effect across an arbitrary network. Sending an external notification and committing a local database record, for example, cannot be treated as one indivisible action without additional coordination or a carefully designed recovery workflow.
Availability is improved through redundant server instances, health checks, replication, and failover. Redundancy is effective only when the replicas do not share all the same failure causes. Two instances in one power domain remain vulnerable to the same power failure; several services depending on one authentication service share that dependency’s availability. Failover can also create a split-brain condition in which multiple nodes believe they hold exclusive authority, requiring mechanisms that prevent conflicting writes.
Overload recovery needs particular care. Simultaneous retries can amplify the original failure, especially when many clients use identical timeout intervals. Exponential backoff with random variation spreads later attempts over time. Bounded queues, request deadlines, and backpressure restrict the accumulation of work that a service cannot complete. Operational evidence comes from correlated request identifiers, logs, metrics, and distributed traces that reveal where a request waited or failed along its dependency path.
Security and trust boundaries
A server typically receives input from clients it does not fully trust. The client may be buggy, compromised, modified, or deliberately hostile. Consequently, checks performed in a user interface are not sufficient protection for server resources. A disabled button does not prevent a caller from constructing the underlying request directly. Servers must validate message structure, permitted values, operation ordering, and access to the specific objects named in a request.
Authentication establishes an identity or verifies control of a credential; authorization determines which operations that identity may perform. The distinction is essential in multiuser services. A correctly authenticated user must not be able to retrieve another user’s private record merely by changing an identifier in a request. Authorization often combines the requested action, the target resource, ownership or group membership, and current policy. Checks may be required at several layers, especially when a user-facing service calls more privileged internal services.
Transport Layer Security protects communication against eavesdropping and undetected modification and commonly authenticates the server through certificates. Mutual authentication can also identify the client at the transport layer. These protections apply to the connection between its endpoints. If a reverse proxy terminates TLS, the proxy becomes part of the trusted path, and protection of the onward connection must be considered separately. Encryption in transit does not prevent an authorized endpoint from mishandling data after decryption.
Input handling exposes characteristic application risks. A server that incorporates untrusted text directly into a database command can create an injection vulnerability; parameterized queries separate data values from command structure. Unsafe parsing and memory handling can produce other vulnerabilities, including buffer overflows. Browser-based clients introduce additional boundaries, including the same-origin policy, cross-origin request rules, and protections against unintended credential use. These browser mechanisms do not replace authentication or authorization on the server.
Resource consumption is also a security concern. A denial-of-service attack may exhaust connections, processing time, memory, or downstream capacity. Defensive controls include per-client or per-identity limits, bounds on request size and execution cost, and isolation between workloads. Limits must account for asymmetric operations: a small request can trigger an expensive database query or a large amount of computation. Public-facing services commonly distinguish cheap preliminary validation from resource-intensive work.
Centralized services can simplify patching, audit collection, and policy enforcement, but they also concentrate sensitive information and operational authority. A compromised server credential may expose many clients’ data, while a compromised client may abuse the permissions of one account. Security analysis therefore follows explicit trust boundaries and least-privilege relationships rather than assuming that every component inside an organizational network is trustworthy. Backups, audit records, credential rotation, and separation of administrative access address different consequences of a breach and are not interchangeable controls.
Applications, alternatives, and architectural trade-offs
The Web is the most visible client–server application, but it is only one instance. Email combines user-facing clients with cooperating mail servers: submission and relay commonly use SMTP, while mailbox access can use IMAP or other interfaces. A mail server receiving a message from another server acts as the service provider in that exchange, even though both machines are conventionally called servers. This illustrates why interaction roles are more precise than permanent machine labels.
Database access, network printing, remote file systems, multiplayer games, and industrial monitoring use different allocations of client and server work. A database client may submit declarative queries and leave execution planning to the server. An authoritative game server may maintain the accepted world state while clients predict movement locally to improve responsiveness. A monitoring device may collect measurements while a central service stores them and supplies dashboards. Each design selects a boundary suited to its data volumes, latency requirements, and trust assumptions.
Thin and thick clients represent points on a spectrum. A thin client depends heavily on remote processing, whereas a thick client performs more application work locally. Browser applications complicate the historical distinction because JavaScript can execute substantial logic on the user’s device. A single-page application may render its interface locally while obtaining data through service APIs. Conversely, server-side rendering produces page content remotely and sends it to the browser, sometimes followed by client-side execution. Presentation location is therefore a separate decision from the use of client–server communication.
Intermittent connectivity motivates local-first and offline-capable behavior. A client may retain a local data copy, queue operations, and synchronize later. This reduces immediate dependence on a live server but creates conflict-resolution and synchronization problems. Two clients can edit the same object while disconnected, and neither local copy alone determines the intended combined result. The server may remain an authority, or the system may use more decentralized reconciliation rules; offline support does not automatically eliminate the client–server relationship.
Peer-to-peer architecture distributes service provision among participating peers rather than relying exclusively on designated service providers. It can spread storage or transfer load and reduce dependence on particular central endpoints. It also creates challenges in discovery, coordination, trust, and operation when participants frequently join and leave. Many deployed systems are hybrids: a central service handles identity or discovery while peers exchange some data directly. Likewise, edge computing relocates selected server functions near users or devices without necessarily changing their logical roles.
Cloud functions and managed platforms abstract server provisioning, but they do not remove service execution or its limits. A “serverless” function still receives requests, uses finite compute resources, and depends on storage and network services. Architectural choice consequently turns on concrete requirements: who controls the authoritative data, where computation can occur, what happens during disconnection, which parties are trusted, and how failures propagate across the chosen boundaries.