
Travis N. answered 12/08/21
Lead Software Engineer at CCHCS and 4.0 GPA CS Graduate Student
This is a great question.
In short, the server-client relationship is relative. That is, a process can sometimes act as a server and other times as a client.
Imagine a web app where a user logs in to see their email. The first thing a user must do is authenticate themselves with the email server so that the server can decide to grant them access or not.
So:
[ User ] -- | send username/password | -> [ Email Server ]
Now, the Email Server doesn't handle authentication directly. It actually consults an authentication server. So, what happens next is:
[ Email Server ] -- |forwards username/password| --> [ Authentication Server ]
This process unwinds with the authentication server sending a response to the email server, and the email server either granting or denying access to the user based on the authentication servers response.
Now, back to the original question:
Step 1: The Email Server was acting as a server to the user.
Step 2: The Email Server was acting as a client to the Authentication Server.
So, in summary, the server-client relationship is relative and should be assessed from the perspective of the action. A client makes a request, and a server services that request. Some processes can be dedicated clients that only consume information from servers. And, some processes can be dedicated servers, only servicing requests from clients. But, increasingly, a given server is likely to both act as a server and a client.