The client–server model, or client–server architecture, is an approach to computer network programming in which computers in a network assume one of two roles: The server selectively shares its resources, and the client initiates contact with a server in order to use those resources.
How clients and servers communicate
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 client-server protocols operate in the application layer. The application-layer protocol defines the basic patterns of the dialogue. To formalize exchange data even further, the server may implement an API (such as a web service). The API is an abstraction layer for such resources as databases and custom software. 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 different clients in a very short period of time. Because the computer can perform a limited number of tasks at any moment, it relies on a scheduling system to prioritize incoming requests from clients in order to accommodate them all in turn. To prevent abuse and maximize uptime, the server's software limits how a client can use the server's resources. Even so, a server is not immune from abuse. A denial of service attack exploits a server's obligation to process requests by bombarding it with requests incessantly. This inhibits the server's ability to responding to legitimate requests.
What does a server serve?
Servers are classified by the services they provide. A web server serves web pages; a file server serves computer files. However, by requesting a web page or a file, a client implicitly makes use of the server's resources, like memory, CPU cycles, and software. A resource is virtually any of the computer's software and electronic components, from programs and data to processors and storage devices. Collectively, shared resources on a server constitute a service.
Because the service is an abstraction of computer resources, the client does not have to be concerned with how the server formulates a response. The client only has to understand the response—which it can do because the client and server use the same communications protocols. Communications protocols are the languages computers use to communicate over a network. The data transmitted in this way is divided into units called network packets. In addition to the data itself (the payload), each packet is encoded with information essential for transmission, such as the source and destination. Because network packets don't exceed a maximum size, the payload may either be the entire message or just part of it.
The roles of client and server
Whether a computer is a client, a server, or both, it can serve multiple functions. For example, a single computer can run web server and file server software at the same time to serve different data to clients making different kinds of requests. 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.
When a bank customer accesses online banking services with a web browser (the client), she initiates a request to the bank's web server. Since the customer's login credentials are stored in a database, the web server runs a program to access a database server. This database server may, in turn, fetch financial transaction records from another database server. An application server interprets the returned data by following the bank's business logic, and provides the output to the web server. Finally, the web server sends the result to the web browser, which interprets the data.
Each server listed above acts as a client when it submits data in a request to another server for processing. 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.
While formulating the client–server model in the 1960s and 1970s, computer scientists at Xerox and Xerox PARC in California used the terms server-host (or serving host) and user-host (or using-host).
One context in which researchers used these terms was in the design of a computer network programming 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 established ARPANET (predecessor of Internet).
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 user-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.)
The concepts of server-host and user-host predate the Internet protocol suite. In the early 1980s, there were several variations of the network-layer model, which is now standardized as the OSI model. One of these, the ARPANET Reference Model, is a host-oriented model that combines the network layer and the transport layer into a host-to-host communication layer.
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 amount 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.
A thin client has few resources other than input devices and output devices. It relies heavily on network resources (servers and infrastructure) for computation and storage. A diskless node loads even its operating system 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 fat client, such as a personal computer, 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 fat 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 developed for a specific microarchitecture. This maturation, more affordable mass storage, and the advent of service-oriented architecture were among the factors that gave rise to the cloud computing trend of the 2010s.
Comparison with peer-to-peer architecture
In modern applications of the client–server model, the server is often designed to be a centralized system that serves many clients. The more simultaneous clients a server has, the more resources it needs.
In a peer-to-peer (P2P) network, two or more computers (called peers) pool their resources and communicate in a decentralized system. Peers are coequal nodes in a non-hierarchical network. Unlike clients in a client–server or client–queue–client network, peers communicate with each other directly.
In a centralized system, servers not only need enough resources to process requests from all clients, but also load balancing and failover systems. In peer-to-peer networking, an algorithm 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 one or more other peers offers it. Ideally, a peer does not need to achieve high availability because other, redundant peers make up for any resource downtime; as the availability and load capacity of peers change, the protocol reroutes requests.
The client–server and peer-to-peer models alike are used in distributed computing applications.
- Padlipsky, Michael A. (September 1982). A Perspective on the ARPANET Reference Model. IETF. RFC 871. https://tools.ietf.org/html/rfc871. Retrieved 30 November 2013.
- Benatallah, B.; Casati, F.; Toumani, F. (2004). "Web service conversation modeling: A cornerstone for e-business automation". IEEE Internet Computing 8: 46. doi:10.1109/MIC.2004.1260703.
- Dustdar, S.; Schreiner, W. (2005). "A survey on web services composition". International Journal of Web and Grid Services 1: 1. doi:10.1504/IJWGS.2005.007545.
- The X Window System is one example.
- Rulifson, Jeff (June 1969). DEL. IETF. RFC 5. https://tools.ietf.org/html/rfc5. Retrieved 30 November 2013.
- Shapiro, Elmer B. (March 1969). Network Timetable. IETF. RFC 4. https://tools.ietf.org/html/rfc4. Retrieved 30 November 2013.
- Sturgis, Howard E.; Mitchell, James George; Israel, Jay E. (1978). "Separating Data from Function in a Distributed File System". Xerox PARC.
- Harper, Douglas. "server". Online Etymology Dictionary. Retrieved 30 November 2013.
- "Separating data from function in a distributed file system". GetInfo. German National Library of Science and Technology. Retrieved 29 November 2013.
- Nieh, Jason; Novik, Naomi; Yang, S. Jae (December 2005). "A Comparison of Thin-Client Computing Architectures" (PDF). Technical Report CUCS-022-00 (New York: Network Computing Laboratory, Columbia University). Retrieved 30 November 2013.
- Tolia, Niraj; Andersen, David G.; Satyanarayanan, M. (March 2006). "Quantifying Interactive User Experience on Thin Clients" (PDF). Computer (IEEE Computer Society) 39 (3).
- d'Amore, M. J.; Oberst, D. J. (1983). "Microcomputers and mainframes". Proceedings of the 11th annual ACM SIGUCCS conference on User services - SIGUCCS '83. p. 7. doi:10.1145/800041.801417. ISBN 0897911164.
- Otey, Michael (22 March 2011). "Is the Cloud Really Just the Return of Mainframe Computing?". SQL Server Pro. Penton Media. Retrieved 1 December 2013.
- Barros, A. P.; Dumas, M. (2006). "The Rise of Web Service Ecosystems". IT Professional 8 (5): 31. doi:10.1109/MITP.2006.123.
- Yongsheng, H.; Xiaoyu, T.; Zhongbin, T. (2013). "An Optimization Model for the Interconnection among Peers of the P2P Network". Journal of Applied Sciences 13 (5): 700. doi:10.3923/jas.2013.700.707.