DO NOT USE ALONE. The client-server model is a centralized model, in which a server performs a specialized service (such as HTTP, SMTP, etc.) for multiple clients on request. Use for issues regarding client server communication. Use with a appropriate language tag(eg: [python]).
The client-server centralized model is a model in which servers perform services for many clients, who request them, typically over a network. The client-server model contrasts with the peer-to-peer model.
Typically, a client-server interaction will work as such:
- The client connects to the server and issues a request. The request is formatted to any one of a number of protocols, depending on the server type.
- The server receives the request, and begins processing it. While this happens, the client is made to wait.
- The server sends the client a response which typically contains both a status (whether or not there was an error) and content (which is whatever the client asked for originally).
- The client or the server can either terminate the connection, or keep it alive for further requests.
Writing in a client-server domain presents a number of challenges:
- Many, many clients may be requesting services at any given time. This issue is commonly faced by websites, and is typically solved with multiple layers of load-balancing and caching. Wikipedia's architecture is an example of this (albeit an unusually complex example).
- Networks can easily become unreliable, and sessions can be terminated at any time.
- Security can be an issue, due to security compromises like a Man In The Middle attack. Cryptography algorithms (like SSL) are widely deployed in various networking areas to combat this.