I'm looking for a simple definition of the concept of "client-server"
I'd like something similar to this definition of state.
... That "thing/information" that you need to remember is called "state".
Edit - This isn't a homework question (nor am I a student). My goal is to come up with a compact way of explaining REST to average developers. I didn't want to prejudice the response though.
-
When you go to a restaurant, you are a client. The server gives you what you want...if you can pay for it.JoshRagem– JoshRagem02/27/2013 07:26:05Commented Feb 27, 2013 at 7:26
-
@JoshRagem - Thanks for the comment but I'm not really looking for an analogy, just a definition that's concise, precise, and accessible to an average developer.Rodrick Chapman– Rodrick Chapman02/27/2013 07:30:27Commented Feb 27, 2013 at 7:30
-
1Is this a homework question?GordonM– GordonM02/27/2013 07:42:46Commented Feb 27, 2013 at 7:42
-
@GordonM - No (check my stackoverflow profile for evidence). I am writing a paper but I am not a student.Rodrick Chapman– Rodrick Chapman02/27/2013 08:04:37Commented Feb 27, 2013 at 8:04
-
2You do know How I Explained REST to My Wife, do you? Anyone who wants to explain REST should have read that!Joachim Sauer– Joachim Sauer02/27/2013 12:10:32Commented Feb 27, 2013 at 12:10
6 Answers 6
client/server refers to a relationship between two networked computers in which one machine (the client) initiates a connection and makes requests of the other machine (the server), which in turn to fulfill those requests. Servers exist to provide a service which clients consume.
Also, have you checked the Wikipedia article on REST? The second paragraph gives a similar definition which may help:
REST-style architectures consist of clients and servers. Clients initiate requests to servers; servers process requests and return appropriate responses. Requests and responses are built around the transfer of representations of resources. A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource.
-
is it possible that server can contact/make request to client first? is it always uni-directional? client asking for resources and server providing them?Hemant– Hemant02/27/2013 08:50:04Commented Feb 27, 2013 at 8:50
-
6No -- the client/server relationship is asymmetrical. Servers sit there listening for connections; clients initiate connections and make requests. The term for a symmetrical relationship, in which either machine can connect to the other and either can make requests of the other, is peer to peer.Caleb– Caleb02/27/2013 08:57:19Commented Feb 27, 2013 at 8:57
-
1I should say, though, that in some cases the client and server can agree to swap roles. For example, we usually think of SMTP as a client/server protocol, but it includes a
TURN
command which lets the message sender become the receiver and vice versa. Also, there's nothing to prevent a server from being a client of another server.Caleb– Caleb02/27/2013 09:08:31Commented Feb 27, 2013 at 9:08 -
3@RodrickChapman If you want to make the definition above more general, simply change networked computer and machine to entity, object, process, or whatever suits you. The phrase client/server is used adjectivally to describe a certain kind of relationship; the nature of the actors isn't all that important.Caleb– Caleb02/27/2013 09:37:15Commented Feb 27, 2013 at 9:37
-
1+1 a server provides a service. It's been years since I programmed in it but IIRC the X Window system treated the end-user workstation/x-terminal as 'the server' and the Sun server as 'the client'. why? the workstation 'provided the graphic/display services' and the Sun server was the client that was requesting the graphics services so images & windows were drawn and displayed.jqa– jqa02/27/2013 15:29:44Commented Feb 27, 2013 at 15:29
One possibility is something like:
A client-server scheme is one in which the consumer (client) and producer (server) of a resource are designed to communicate by passing messages (intelligible objects that can exist independently of the client and server).
From Wikipedia:
A server is a computer system that selectively shares its resources; a client is a computer or computer program that initiates contact with a server in order to make use of a resource.
-
1"selectively shares its resources" is a.) somewhat misleading and b.) not really "a simple definition".Joachim Sauer– Joachim Sauer02/27/2013 12:11:44Commented Feb 27, 2013 at 12:11
Client/server describes the relationship between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request.
For more information see: What is a client/server?
My teacher said once something like this (somehow it wont dissapear from my head):
In the real world, businesses have clients. In the computer world, servers have clients. The "client-server" architecture is common in both local and wide area networks. For example, if an office has a server that stores the company's database on it, the other computers in the office that can access the database are "clients" of the server.
A server is a computer that does stuff for another computer. The other computer is called a client.