
The client–server model is a
distributed application
A distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another from any system. Distributed computing is a field of computer sci ...
structure that partitions tasks or workloads between the providers of a resource or service, called
servers, and service requesters, called
clients. Often clients and servers communicate over a
computer network
A computer network is a set of computers sharing resources located on or provided by network nodes. The computers use common communication protocols over digital interconnections to communicate with each other. These interconnections ar ...
on separate hardware, but both client and server may reside in the same system. A server
host runs one or more server programs, which share their resources with clients. A client usually does not share any of its resources, but it requests content or service from a server. Clients, therefore, initiate communication sessions with servers, which await incoming requests.
Examples of computer applications that use the client–server model are
email
Electronic mail (email or e-mail) is a method of exchanging messages ("mail") between people using electronic devices. Email was thus conceived as the electronic ( digital) version of, or counterpart to, mail, at a time when "mail" mean ...
, network printing, and the
World Wide Web
The World Wide Web (WWW), commonly known as the Web, is an information system enabling documents and other web resources to be accessed over the Internet.
Documents and downloadable media are made available to the network through web se ...
.
Client and server role
The "client–server" characteristic describes the relationship of cooperating programs in an application. The server component provides a function or service to one or many clients, which initiate requests for such services.
Servers are classified by the services they provide. For example, a
web server serves
web pages and a
file server
In computing, a file server (or fileserver) is a computer attached to a network that provides a location for shared disk access, i.e. storage of computer files (such as text, image, sound, video) that can be accessed by the workstations that are ab ...
serves
computer file
A computer file is a computer resource for recording data in a computer storage device, primarily identified by its file name. Just as words can be written to paper, so can data be written to a computer file. Files can be shared with and trans ...
s. A
shared resource may be any of the server computer's software and electronic components, from
programs
Program, programme, programmer, or programming may refer to:
Business and management
* Program management, the process of managing several related projects
* Time management
* Program, a part of planning
Arts and entertainment Audio
* Programm ...
and
data
In the pursuit of knowledge, data (; ) is a collection of discrete values that convey information, describing quantity, quality, fact, statistics, other basic units of meaning, or simply sequences of symbols that may be further interpret ...
to
processors and
storage devices. The sharing of resources of a server constitutes a ''service''.
Whether a computer is a client, a server, or both, is determined by the nature of the application that requires the service functions. For example, a single computer can run a web server and file server software at the same time to serve different data to clients making different kinds of requests. The client software can also communicate with server software within the same computer. Communication between servers, such as to synchronize data, is sometimes called ''
inter-server'' or ''server-to-server'' communication.
Client and server communication
Generally, a service is an
abstraction
Abstraction in its main sense is a conceptual process wherein general rules and concepts are derived from the usage and classification of specific examples, literal ("real" or " concrete") signifiers, first principles, or other methods.
"An a ...
of computer resources and a client does not have to be
concerned
''Concerned: The Half-Life and Death of Gordon Frohman'' is a webcomic by Christopher C. Livingston that parodies the first-person shooter video game ''Half-Life 2''. The comic is illustrated with screenshots of characters posed using ''Garry's ...
with how the server performs while fulfilling the request and delivering the response. The client only has to understand the response based on the well-known application protocol, i.e. the content and the formatting of the data for the requested service.
Clients and servers exchange messages in a
request–response messaging pattern. The client sends a request, and the server returns a response. This exchange of messages is an example of
inter-process communication. To communicate, the computers must have a common language, and they must follow rules so that both the client and the server know what to expect. The language and rules of communication are defined in a
communications protocol. All protocols operate in the
application layer. The application layer protocol defines the basic patterns of the dialogue. To formalize the data exchange even further, the server may implement an
application programming interface (API). The API is an
abstraction layer for accessing a service. By restricting communication to a specific
content format, it facilitates
parsing. By abstracting access, it facilitates cross-platform data exchange.
A server may receive requests from many distinct clients in a short period. A computer can only perform a limited number of
tasks at any moment, and relies on a
scheduling
A schedule or a timetable, as a basic time-management tool, consists of a list of times at which possible tasks, events, or actions are intended to take place, or of a sequence of events in the chronological order in which such things are i ...
system to prioritize incoming requests from clients to accommodate them. To prevent abuse and maximize
availability, the server software may limit the availability to clients.
Denial of service attacks are designed to exploit a server's obligation to process requests by overloading it with excessive request rates.
Encryption should be applied if sensitive information is to be communicated between the client and the server.
Example
When a
bank
A bank is a financial institution that accepts deposits from the public and creates a demand deposit while simultaneously making loans. Lending activities can be directly performed by the bank or indirectly through capital markets.
Becau ...
customer accesses
online banking services with a
web browser
A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
(the client), the client initiates a request to the bank's web server. The customer's
login credentials may be stored in a
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
, and the webserver accesses the
database server as a client. An
application server interprets the returned data by applying the bank's
business logic and provides the
output
Output may refer to:
* The information produced by a computer, see Input/output
* An output state of a system, see state (computer science)
* Output (economics), the amount of goods and services produced
** Gross output in economics, the value ...
to the webserver. Finally, the webserver returns the result to the client web browser for display.
In each step of this sequence of client–server message exchanges, a computer processes a request and returns data. This is the request-response messaging pattern. When all the requests are met, the sequence is complete and the web browser presents the data to the customer.
This example illustrates a
design pattern
A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The " Gang of Four" b ...
applicable to the client–server model:
separation of concerns.
Early history
An early form of client–server architecture is
remote job entry, dating at least to
OS/360 (announced 1964), where the request was to run a
job, and the response was the output.
While formulating the client–server model in the 1960s and 1970s,
computer scientists building
ARPANET
The Advanced Research Projects Agency Network (ARPANET) was the first wide-area packet-switched network with distributed control and one of the first networks to implement the TCP/IP protocol suite. Both technologies became the technical foun ...
(at the
Stanford Research Institute) used the terms ''server-host'' (or ''serving host'') and ''user-host'' (or ''using-host''), and these appear in the early documents RFC 5
and RFC 4. This usage was continued at
Xerox PARC in the mid-1970s.
One context in which researchers used these terms was in the design of a
computer network programming
Computer network programming involves writing computer programs that enable processes to communicate with each other across a computer network.
Connection-oriented and connectionless communications
Very generally, most of communications can ...
language called Decode-Encode Language (DEL).
The purpose of this language was to accept commands from one computer (the user-host), which would return status reports to the user as it encoded the commands in network packets. Another DEL-capable computer, the server-host, received the packets, decoded them, and returned formatted data to the user-host. A DEL program on the user-host received the results to present to the user. This is a client–server transaction. Development of DEL was just beginning in 1969, the year that the
United States Department of Defense
The United States Department of Defense (DoD, USDOD or DOD) is an executive branch department of the federal government charged with coordinating and supervising all agencies and functions of the government directly related to national secur ...
established ARPANET (predecessor of
Internet
The Internet (or internet) is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. It is a ''internetworking, network of networks'' that consists ...
).
Client-host and server-host
''Client-host'' and ''server-host'' have subtly different meanings than ''client'' and ''server''. A host is any computer connected to a network. Whereas the words ''server'' and ''client'' may refer either to a computer or to a computer program, ''server-host'' and ''client-host'' always refer to computers. The host is a versatile, multifunction computer; ''clients'' and ''servers'' are just programs that run on a host. In the client–server model, a server is more likely to be devoted to the task of serving.
An early use of the word ''client'' occurs in "Separating Data from Function in a Distributed File System", a 1978 paper by Xerox PARC computer scientists Howard Sturgis, James Mitchell, and Jay Israel. The authors are careful to define the term for readers, and explain that they use it to distinguish between the user and the user's network node (the client). By 1992, the word ''server'' had entered into general parlance.
Centralized computing
The client–server model does not dictate that server-hosts must have more resources than client-hosts. Rather, it enables any general-purpose computer to extend its capabilities by using the shared resources of other hosts.
Centralized computing, however, specifically allocates a large number of resources to a small number of computers. The more computation is offloaded from client-hosts to the central computers, the simpler the client-hosts can be.
It relies heavily on network resources (servers and infrastructure) for computation and storage. A
diskless node loads even its
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
from the network, and a
computer terminal has no operating system at all; it is only an input/output interface to the server. In contrast, a
rich client, such as a
personal computer
A personal computer (PC) is a multi-purpose microcomputer whose size, capabilities, and price make it feasible for individual use. Personal computers are intended to be operated directly by an end user, rather than by a computer expert or tech ...
, has many resources and does not rely on a server for essential functions.
As
microcomputers decreased in price and increased in power from the 1980s to the late 1990s, many organizations transitioned computation from centralized servers, such as
mainframes and
minicomputers, to rich clients. This afforded greater, more individualized dominion over computer resources, but complicated
information technology management.
During the 2000s,
web applications matured enough to rival
application software
Application may refer to:
Mathematics and computing
* Application software, computer software designed to help the user to perform specific tasks
** Application layer, an abstraction layer that specifies protocols and interface methods used in a ...
developed for a specific
microarchitecture
In computer engineering, microarchitecture, also called computer organization and sometimes abbreviated as µarch or uarch, is the way a given instruction set architecture (ISA) is implemented in a particular processor. A given ISA may be imp ...
. This maturation, more affordable
mass storage, and the advent of
service-oriented architecture were among the factors that gave rise to the
cloud computing
Cloud computing is the on-demand availability of computer system resources, especially data storage ( cloud storage) and computing power, without direct active management by the user. Large clouds often have functions distributed over m ...
trend of the 2010s.
Comparison with peer-to-peer architecture
In addition to the client–server model,
distributed computing
A distributed system is a system whose components are located on different networked computers, which communicate and coordinate their actions by passing messages to one another from any system. Distributed computing is a field of computer sci ...
applications often use the
peer-to-peer
Peer-to-peer (P2P) computing or networking is a distributed application architecture that partitions tasks or workloads between peers. Peers are equally privileged, equipotent participants in the network. They are said to form a peer-to-peer ...
(P2P) application architecture.
In the client–server model, the server is often designed to operate as a centralized system that serves many clients. The computing power, memory and storage requirements of a server must be scaled appropriately to the expected workload.
Load-balancing and
failover
Failover is switching to a redundant or standby computer server, system, hardware component or network upon the failure or abnormal termination of the previously active application, server, system, hardware component, or network in a computer n ...
systems are often employed to scale the server beyond a single physical machine.
Load balancing is defined as the methodical and efficient distribution of network or application traffic across multiple servers in a server farm. Each load balancer sits between client devices and backend servers, receiving and then distributing incoming requests to any available server capable of fulfilling them.
In a
peer-to-peer
Peer-to-peer (P2P) computing or networking is a distributed application architecture that partitions tasks or workloads between peers. Peers are equally privileged, equipotent participants in the network. They are said to form a peer-to-peer ...
network, two or more computers (''peers'') pool their resources and communicate in a
decentralized system. Peers are coequal, or equipotent
nodes in a non-hierarchical network. Unlike clients in a client–server or
client–queue–client network, peers communicate with each other directly. In peer-to-peer networking, an
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
in the peer-to-peer communications protocol balances
load, and even peers with modest resources can help to share the load. If a node becomes unavailable, its shared resources remain available as long as other peers offer it. Ideally, a peer does not need to achieve
high availability
High availability (HA) is a characteristic of a system which aims to ensure an agreed level of operational performance, usually uptime, for a higher than normal period.
Modernization has resulted in an increased reliance on these systems. F ...
because other,
redundant peers make up for any resource
downtime; as the availability and load capacity of peers change, the protocol reroutes requests.
Both client–server and
master–slave are regarded as sub-categories of distributed peer-to-peer systems.
[
]
See also
Notes
{{DEFAULTSORT:Client-server model
*
*
Inter-process communication
*
Network architecture