Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

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.

share|improve this question

marked as duplicate by gnat, Kilian Foth, Ryathal, Martijn Pieters, Walter Feb 27 '13 at 17:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
When you go to a restaurant, you are a client. The server gives you what you want...if you can pay for it. –  JoshRagem Feb 27 '13 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 Feb 27 '13 at 7:30
1  
Is this a homework question? –  GordonM Feb 27 '13 at 7:42
    
@GordonM - No (check my stackoverflow profile for evidence). I am writing a paper but I am not a student. –  Rodrick Chapman Feb 27 '13 at 8:04
2  
You do know How I Explained REST to My Wife, do you? Anyone who wants to explain REST should have read that! –  Joachim Sauer Feb 27 '13 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.

share|improve this answer
    
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 Feb 27 '13 at 8:50
6  
No -- 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 Feb 27 '13 at 8:57
1  
I 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 Feb 27 '13 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 Feb 27 '13 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. –  james Feb 27 '13 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).

share|improve this answer

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.

share|improve this answer
1  
"selectively shares its resources" is a.) somewhat misleading and b.) not really "a simple definition". –  Joachim Sauer Feb 27 '13 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?

share|improve this answer

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.

share|improve this answer

A server is a computer that does stuff for another computer. The other computer is called a client.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.