What is a Client?
A client is a computer or a program that, as part of its operation, relies on sending a request to another program or a computer hardware or software that accesses a service made available by a server (which may or may not be located on another computer).
The other side of this relationship is the server, which hosts information and returns it to the client when requested. The client asks for information and consumes it, while the server provides a service.
What is a REST client?
In RESTful APIs, an API sits between the client and the server, and requires authentication to pass through. A client makes a request to an API at an endpoint which it has access to. The API validates the request and passes the request to the destination server or program. The server sends a response back, first through the API, which then transfers it back to the client.
Why put it all in one place?
Sometimes, clients and servers are in the same place, as in the case of a home PC retrieving a document from its own hard drive. But why do we separate clients and servers at, for example, a business?
- Centralized Information Storage - Everyone has the same information, and it's up-to-date. This information might require higher security.
- Collaboration - Having information on one server ideally allows everyone to access information, but it doesn't always work that way. We've seen recently the rise of internal APIs as a way to prevent information silos forming between teams in large companies.
- Resource management - Management between the front end (client) and backend (server) is an engineering balancing act. Servers are significantly more powerful than client hardware.
- Security - The people who need access can get access, and those who don't are kept out.
Conclusion
The client asks, the server serves, and that's how it's been through the rise of the internet, the cloud, and microservices. Even as applications are spread across clusters and development becomes cloud-native, we still have the client sending requests, and the server issuing responses.
Frequently Asked Questions
What is a client in the context of APIs?
A client is a computer or a program that, as part of its operation, relies on sending a request to another program, or to computer hardware or software that accesses a service made available by a server. It is the side that initiates the request for information rather than the side that hosts it.
How does a client work in the client-server model?
The client initiates a request for information, and the server hosts that information and fulfills the request. This request-and-response pattern is fundamental to how the internet operates.
How does a client interact with a REST API?
In a RESTful API, the client makes a request to an API endpoint that it has access to. The API validates the request and passes it to the destination server, and the server returns a response back through the API to the client.
What is the difference between a client and a server?
A client initiates requests for information, while a server hosts that information and fulfills those requests. In frontend and backend terms, the client is the frontend and the server is the backend.
Why are clients and servers kept separate?
Separating clients and servers lets businesses store information centrally so it stays consistent and up to date, makes that information accessible for team collaboration, allows more powerful servers to handle resource management, and improves security through access controls.
Does the client-server model still apply with cloud and microservices?
Yes. Even as applications have evolved across cloud infrastructure and microservices architectures, the fundamental client-server request-and-response pattern remains unchanged.


