Premium lesson

The Client-Server Model

Backend·5 min read·Jan 1, 2025

The client-server model is a type of distributed software architecture that divides tasks between two entity types called clients and servers.

In this model, the client sends a request for a service or a resource to a server, which in turn processes the request, and sends a response containing the execution result of the service or the requested resource back to the client in charge of displaying the result to the user.

For example, a web browser (i.e. the client) that requests a web page to a web server (i.e. the server) and displays it to the user once received.

In the context of the web, clients and servers are usually computer programs running on devices such as computers, phones, and tablets.

Note that while clients and servers communicate over a computer network, they may also both reside on the same system.

Client and server communication

Clients and servers exchange requests and responses over a network, such as a local area network (LAN) or the Internet, using a system of rules called a communication protocol, which defines the syntax, semantics, and synchronization of communication between parties.

Each message has an exact meaning intended to elicit a specific response from a range of possible responses pre-determined for that particular situation.

This means that neither the client nor the server are required to know about each other's implementations in order to generate and process requests and responses, for as long as the message format complies with the communication protocol standards.

Consequently, a single client can send requests to multiple servers, and a single server can serve multiple clients.

For example:

  • Web browsers, such as Google Chrome, are clients that connect to web servers to request and display web pages using the HTTP protocol.
  • Email clients, such as Microsoft Outlook, are clients that connect to mail servers to retrieve and send emails using the SMTP protocol.
  • File clients, such as FileZilla, are clients that connect to file servers to upload and download files such as documents, images, videos, and so on, using the FTP protocol.

That being said, it may happen that similar types of clients, such as email clients, use different protocols to achieve more or less the same result.

For instance, they may either use:

    icon light bulb key

    Unlock the Build RESTful APIs in Node.js module

    Learn how to build real database-backed and framework-powered RESTful APIs with MySQL, Sequelize, and Express.

    You get immediate access to:

    • 37 focused lessons across MySQL, Sequelize, backend, and Express
    • 4 real-world projects with commented solutions
    • Ongoing updates to this bundle
    • Lifetime access to this bundle
    Unlock this module