educative.io

Educative

How are you storing user to connection object?

Topic in chapter: How do we know which server holds the connection to which user?
We can
introduce a software load balancer in front of our chat servers; that can map each
UserID to a server to redirect the request

At bottom you say ,“The chat server will first find the server that holds the connection for the receiver”

How can chat server finds this if this info is with load balancer?Load balancer should ideally accept request from client and not from chat server.

Can you please clarify?


Course: Grokking the System Design Interview - Learn Interactively
Lesson: Designing a URL Shortening service like TinyURL - Grokking the System Design Interview

Hi @rahul9, we are glad you reached us.

Can you please specify the topic/section within the lesson that concerns your question?

Educative would love to help you :slight_smile:

Design Facebook Messanger @Noor_Awan

Hi @rahul9, we are glad you reached us.

So the question under concern is about load balancers; when there is a message from the sender, the chat server finds the receivers’ server from the load balancer. Chat server uses load balancers for locating the receiver, so in this case, generally ( at a high level), we can say that the chat server will first find the server that holds the connection for the receiver and specifically, we can say that the chat server uses load balancer to find the receiver’s server.
Chat servers do the message sending/receiving and sending acknowledgments whereas load balancers map each UserID to a server to redirect the request; both units perform their tasks so that the whole process flows smoothly.

Educative loves to help you :slight_smile: