Client–server model: Difference between revisions

Content deleted Content added
m Server-side: removed the dash for consistency
 
(11 intermediate revisions by 8 users not shown)
Line 1:
{{Short description|Distributed application structure in computing}}{{More citations needed|article (some sections)|date=March 2024}}[[File:Client-server-model.svg|thumb|250px|A computer network diagram of clients communicating with a server via the Internet]]
 
[[The]] '''client–server model''' is a [[distributed application]] structure that partitions tasks or workloads between the providers of a resource or service, called [[Server (computing)|servers]], and service requesters, called [[client (computing)|client]]s.<ref>{{cite web|url=http://java.sun.com/developer/Books/jdbc/ch07.pdf|publisher=Sun Microsystem|title=Distributed Application Architecture|archive-url=https://web.archive.org/web/20110406121920/http://java.sun.com/developer/Books/jdbc/ch07.pdf|access-date=2009-06-16|archive-date=6 April 2011}}</ref> Often clients and servers communicate over a [[Computer networking device|computer network]] on separate hardware, but both client and server may be on the same device. A server [[Host (network)|host]] runs one or more server programs, which share their resources with clients. A client usually does not share its computing resources, but it requests content or service from a server and may share its own content as part of the request. Clients, therefore, initiate communication sessions with servers, which await incoming requests.
Examples of computer applications that use the client–server model are [[email]], network printing, and the [[World Wide Web]].
 
Line 25:
This example illustrates a [[design pattern]] applicable to the client–server model: [[separation of concerns]].
 
==Server -side==
{{See also|Backend (computing)|Server-side scripting|Server Side Includes|label 3=Server Side Includes (SSI)}}
{{More citations needed|section|small=y|date=December 2016}}
Server-side refers to programs and operations that run on the [[server (computing)|server]]. In contrast, client-side programs and operations run on the [[client (computing)|client]].<ref name="stackexchange" /> <ref>{{Cite web |title=Ada Computer Science |url=https://adacomputerscience.org/concepts/webtech_server |access-date=2025-04-03 |website=Ada Computer Science |language=en}}</ref> Server-side operations are part of many web applications and services, enabling secure data management <ref>{{Cite journal |date=2010 |editor-last=Jonker |editor-first=Willem |editor2-last=Petković |editor2-first=Milan |title=Secure Data Management |url=https://link.springer.com/book/10.1007/978-3-642-15546-8 |journal=Lecture Notes in Computer Science |language=en |doi=10.1007/978-3-642-15546-8 |issn=0302-9743}}</ref>, complex computation, and centralised control.<ref>{{Cite web |last=Mehrab |first=Abu |date=2025 |title=Centralized Control: Revolutionizing All End-User Computer Management from a Single Hub. |url=https://www.researchgate.net/publication/389889730_Centralized_Control_Revolutionizing_All_End-User_Computer_Management_from_a_Single_Hub}}</ref>
 
Server-side refers to programs and operations that run on the [[server (computing)|server]]. This is in contrast to client-side programs and operations which run on the [[client (computing)|client]].
=== General concepts ===
"Server-side software" refers to a [[computer application]], such as a [[web server]], that runs on remote [[server (computing)#Hardware|server hardware]], reachable from a [[user (computing)|user]]'s local [[computer]], [[smartphone]], or other device. Common examples include web servers, application servers, and database systems. Operations are often performed server-side are:
 
=== General concepts ===
* Functionalities that should not be exposed to the client because they involve sensitive data.
"Server-side software" refers to a [[computer application]], such as a [[web server]], that runs on remote [[server (computing)#Hardware|server hardware]], reachable from a [[user (computing)|user]]'s local [[computer]], [[smartphone]], or other device.<ref>{{cite web |url=https://www.cloudflare.com/en-gb/learning/serverless/glossary/client-side-vs-server-side/ |title=What do client side and server side mean? Client side vs. server side |publisher=Cloudflare |access-date=17 April 2025 }}</ref> Operations may be performed server-side because they require access to information or functionality that is not available on the [[client (computing)|client]], or because performing such operations on the [[client-side|client side]] would be slow, unreliable, or [[computer security|insecure]].
* Computationally intensive tasks that require powerful server hardware.
* Sensitive processes whose vulnerabilities can be reduced by centralising databases and operations.
 
Client and server programs may be commonly available ones such as free or commercial [[web server]]s and [[web browser]]s, communicating with each other using standardized [[protocol (computing)|protocols]]. Or, [[programmer]]s may write their own server, client, and [[communications protocol]] which can only be used with one another.
 
Server-side operations include both those that are carried out in response to client requests, and non-client-oriented operations such as maintenance tasks.<ref>{{Cite web |date=2023-11-05 |title=Introduction to the server side - Learn web development {{!}} MDN |url=https://developer.mozilla.org/en-US/docs/Learn/Server-side/First_steps/Introduction |access-date=2023-11-13 |website=developer.mozilla.org |language=en-US}}</ref><ref>{{Cite web |date=2023-06-30 |title=Server-side website programming - Learn web development {{!}} MDN |url=https://developer.mozilla.org/en-US/docs/Learn/Server-side |access-date=2023-11-13 |website=developer.mozilla.org |language=en-US}}</ref>
 
Server-side operations can be processing database queries, managing user authentication, running complex algorithms, rendering web pages dynamically, and handling file storage and retrieval. One real-world application of server-side operations is, for example, dynamic content generation: based on user requests and data stored in a database, a server can dynamically tailor HTML pages by displaying personalised product recommendations on an e-commerce site.<ref>{{Cite web |date=2024-07-20 |title=Server-Side Rendering (SSR) in Web Development |url=https://dev.to/hillaryprosper_wahua_bce/server-side-rendering-ssr-in-web-development-1oi0 |access-date=2025-04-03 |website=DEV Community |language=en}}</ref> Also tasks such as sending email, scheduling tasks, and managing network resources are typically handled server-side.
 
=== Computer security ===
Line 49 ⟶ 44:
In the case of [[distributed computing]] projects such as [[SETI@home]] and the [[Great Internet Mersenne Prime Search]], while the bulk of the operations occur on the client side, the servers are responsible for coordinating the clients, sending them data to analyze, receiving and storing results, providing reporting functionality to project administrators, etc. In the case of an Internet-dependent user application like [[Google Earth]], while querying and display of map data takes place on the client side, the server is responsible for permanent storage of map data, resolving user queries into map data to be returned to the client, etc.
 
However, webWeb applications and [[web service|services]] can be implemented in almost any language, as long as they can return data to standards-based web browsers (possibly via intermediary programs) in formats which they can use.
In the context of the [[World Wide Web]], commonly encountered server-side computer languages include:<ref name=stackexchange>{{cite web|url=http://softwareengineering.stackexchange.com/questions/171203/what-are-the-differences-between-server-side-and-client-side-programming|title=What are the differences between server-side and client-side programming?|website=softwareengineering.stackexchange.com|access-date=2016-12-13}}</ref>
* [[C Sharp (programming language)|C#]] or [[Visual Basic]] in [[ASP.NET]] environments
* [[Java (programming language)|Java]]
* [[Perl]]
* [[PHP]]
* [[Python (programming language)|Python]]
* [[Ruby (programming language)|Ruby]]
* [[Node.js]]
* [[Swift (programming language)|Swift]] (with frameworks like [[Vapor (web framework)|Vapor]] and [[Kitura]])
* Go
 
However, web applications and [[web service|services]] can be implemented in almost any language, as long as they can return data to standards-based web browsers (possibly via intermediary programs) in formats which they can use.
 
==Client side==
Line 79 ⟶ 63:
=== Examples ===
[[Distributed computing]] projects such as [[SETI@home]] and the Great Internet Mersenne Prime Search, as well as Internet-dependent applications like [[Google Earth]], rely primarily on client-side operations. They initiate a connection with the server (either in response to a user query, as with Google Earth, or in an automated fashion, as with SETI@home), and request some data. The server selects a data set (a [[server-side]] operation) and sends it back to the client. The client then analyzes the data (a client-side operation), and, when the analysis is complete, displays it to the user (as with Google Earth) and/or transmits the results of calculations back to the server (as with SETI@home).
 
In the context of the [[World Wide Web]], commonly encountered computer languages which are evaluated or run on the client side include:<ref name=stackexchange />
* [[Cascading Style Sheets|Cascading Style Sheets (CSS)]]
* [[HTML]]
* [[JavaScript]]
 
==Early history==
Line 102 ⟶ 81:
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.<ref name="Columbia">{{cite journal |last1=Nieh |first1=Jason |last2=Yang |first2=S. Jae |last3=Novik |first3=Naomi |title=A Comparison of Thin-Client Computing Architectures |journal=Academic Commons |date=2000 |doi=10.7916/D8Z329VF |url=https://academiccommons.columbia.edu/doi/10.7916/D8Z329VF |access-date=28 November 2018 |language=en}}</ref> 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 [[rich client]], such as a [[personal computer]], has many resources and does not rely on a server for essential functions.
 
As [[microcomputer]]s decreased in price and increased in power from the 1980s to the late 1990s, many organizations transitioned computation from centralized servers, such as [[Mainframe computer|mainframe]]s and [[minicomputer]]s, to rich clients.<ref>{{Cite book | last1 = d'Amore | first1 = M. J. | last2 = Oberst | first2 = D. J. | doi = 10.1145/800041.801417 | chapter = Microcomputers and mainframes | title = Proceedings of the 11th annual ACM SIGUCCS conference on User services - SIGUCCS '83 | pages = 7 | year = 1983 | isbn = 978-0897911160 | s2cid = 14248076 }}</ref> This afforded greater, more individualized dominion over computer resources, but complicated [[information technology management]].<ref name="Columbia"/><ref name="tolia">{{Cite journal |last1 = Tolia |first1 = Niraj |last2 = Andersen |first2 = David G. |last3 = Satyanarayanan |first3 = M. |title = Quantifying Interactive User Experience on Thin Clients |journal = [[Computer (magazine)|Computer]] |volume = 39 |pages = 46–52 |number = 3 |date = March 2006 |publisher = [[IEEE Computer Society]] |url = https://www.cs.cmu.edu/~dga/papers/tolia06-ieee.pdf |doi = 10.1109/mc.2006.101 |s2cid = 8399655 }}</ref><ref>{{cite web |url=http://sqlmag.com/cloud/cloud-really-just-return-mainframe-computing |title=Is the Cloud Really Just the Return of Mainframe Computing? |last=Otey |first=Michael |date=22 March 2011 |website=[[SQL Server Pro]] |publisher=[[Penton Media]] |access-date=1 December 2013 |archive-url=https://web.archive.org/web/20131203011958/http://sqlmag.com/cloud/cloud-really-just-return-mainframe-computing |archive-date=3 December 2013 |url-status=dead }}</ref> During the 2000s, [[web application]]s 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.<ref>{{Cite journal | last1 = Barros | first1 = A. P. | last2 = Dumas | first2 = M. | doi = 10.1109/MITP.2006.123 | title = The Rise of Web Service Ecosystems | journal = IT Professional | volume = 8 | issue = 5 | pages = 31 | year = 2006 | s2cid = 206469224 }}</ref>{{failed verification|date=March 2024}}
 
==Comparison with peer-to-peer architecture==
Line 111 ⟶ 90:
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]] network, two or more computers (''peers'') pool their resources and communicate in a [[decentralized system]]. Peers are coequal, or equipotent [[Node (networking)|nodes]] in a non-hierarchical network. Unlike clients in a client-server or [[client-queue-client]] network, peers communicate with each other directly. <ref>{{citationCite journal needed|date last1 =August 2019Alharbi | first1 = A. | last2 = Aljaedi | first2 = A. | title = Peer-to-Peer Network Security Issues and Analysis: Review | journal = IJCSNS International Journal of Computer Science and Network Security | doi = 10.1007/978-3-540-45172-3_6 | year = 2004 }}</ref> In peer-to-peer networking, an [[algorithm]] in the peer-to-peer communications protocol balances [[Load (computing)|load]], and even peers with modest resources can help to share the load.<ref>{{citationCite journal needed|date last1 =August 2019Rao | first1 = A. | last2 = Lakshminarayanan | first2 = K. | last3 = Surana | first3 = S.| last4 = Manning Karp | first4 = R. | title = Load Balancing in Structured P2P Systems | journal = IJCSNS International Journal of Computer Science and Network Security | volume = 20 | pages = 74–88 | year = 2020 }}</ref> 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]] because other, [[Redundancy (engineering)|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 (technology)|master-slave]] are regarded as sub-categories of distributed peer-to-peer systems.<ref>
Line 159 ⟶ 138:
[[Category:Inter-process communication]]
[[Category:Network architecture]]
[[Category:Distributed computing architecture]]