1

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.

Rodrick Chapman
  • 289
  • 2
  • 11

6 Answers6

8

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.

Caleb
  • 38,959
  • 8
  • 94
  • 152
  • 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 08: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 08:57
  • @Caleb I like the notion of symmetry. There is at least one problem with the definition though - it assumes that the participants must be running on distinct computers when in fact they could be running on the same thread in the same process. – Rodrick Chapman Feb 27 '13 at 09:05
  • 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 09:08
  • *assumes that the participants must be running on distinct computers* You said that you wanted a "simple" definition, so I assumed some context. Yes, of course, clients and servers don't have to be entire machines, but it's easier to visualize a computer than a process or an object inside a process. – Caleb Feb 27 '13 at 09:12
  • @Caleb - apologies for the miscommunication. I do want a simple definition but you can assume that the audience is comprised of competent developers. – Rodrick Chapman Feb 27 '13 at 09:18
  • @RodrickChapman So it sounds like what you really want is help in phrasing the definition rather than help with understanding the concept? That seems like something that you should be able to do better than anyone here, since you know the audience you're addressing. You might want to flag this Q and ask a moderator to move it to [English Language & Usage](http://english.stackexchange.com). – Caleb Feb 27 '13 at 09:29
  • 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 09:37
  • @Caleb - How does your definition exclude something like a method call? Not trying to be difficult but one of my goals is to extol the virtues of a client-server architecture in comparison to frameworks that try to make everything look like a method call. Also, I'm looking for help in both phrasing the definition and in better understanding the concept. Even though I've been programming for years, this [question and answer](http://programmers.stackexchange.com/questions/150120/definition-of-state) on state was still useful to me. – Rodrick Chapman Feb 27 '13 at 15:01
  • 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 Feb 27 '13 at 15:29
  • @RodrickChapman Why should method calls be excluded? Next to REST, one of the most common styles of web services is [XML-RPC](http://en.wikipedia.org/wiki/XML-RPC), where the last bit stands for "remote procedure call." What's the real point that you're trying to make in this talk? – Caleb Feb 28 '13 at 04:01
1

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).

Rodrick Chapman
  • 289
  • 2
  • 11
1

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.

thorsten müller
  • 12,058
  • 4
  • 49
  • 54
1

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?

Gaz Winter
  • 211
  • 2
  • 11
1

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.

Haris
  • 216
  • 2
  • 7
0

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

Joachim Sauer
  • 10,956
  • 3
  • 52
  • 45