Perfect video, all functional requirements are covered. Please do add a new section on generic NFR, like how to improve latency and throughput and back of the envelope estimation as well
Could you share any thoughts why do you prefer websocket to grps or graphQL? or just HTTP with long puuling? Supporting two different protocols looks like extra work on bothe client and BE sides
Why are we going with Columnar cassandra database to store the messages? we're not doing any aggregation, and also don't we need our data to be consistent as well? would a document nosql database be better
Great video one doubt let's say when I go online I make websocket connect with chat servicer 1 and do the send thing etc... now I go offline so will that websocket connect b/w me and chat server gets removed and when I go online again so again a websocket connect will be made and this time this connection will be made to some other chat server right?
One more thing if we don't use websocket protocol here then for each msg we will have to make the connection each time for new msg but with this websocket protocol it will make a connection and both client and server can send the messages. My friend was asked to make a bot chat system in which a real user will ask the question and the bot will answer it so the design you have explained can I refer the same design for this thing also?
You can use this but In chat bot a simple http will work because there server is not sending a message rather response to your request. If you ask something to a chat bot, an api will look for that question in some knowledge base and return you a response to the question, this is the case with simple chat botS, which does not involve ML
In the above scenario user2 web-socket connection resides in server S4, so when user1 send message it is received by server S1. How server S1 communicate with server S4 ?
As part of your application, you will query redis to get the websocket connection for the receiver. From redis you know which machine holds the connection object, make a call to that machine to get the object. Btw your application shoould have an internal getter which will share the connection object stored in map.
if a connection object could be shared among servers using Redis, why do we need to be linked to specific server then? can we simply put connection object in Redis cache itself and doesn't store any user-server mapping tables then? I don't think its possible to share connection using Redis, and there's should be simple API endpoint which allows server1 forward user's message to server2
@@ameynaik2743 that is to identify on which server a user connection os present, you can serialize and store this data in 1st table as well, I chose to store on local server in hashtable
Perfect video, all functional requirements are covered.
Please do add a new section on generic NFR, like how to improve latency and throughput and back of the envelope estimation as well
Bro from where u are getting so much knowledge . I watch ur 5 videos all are crystal clear
Thanks for sharing, best video for this topic I've seen so far
Thanks, hope this was helpful :) Do like and subscribe and share with your friends :) check out the other videos on high and low level designs as well
Could you share any thoughts why do you prefer websocket to grps or graphQL? or just HTTP with long puuling? Supporting two different protocols looks like extra work on bothe client and BE sides
Nice video thanks sir✊✊✊
but in functional how are you writing consistency and availability together ?
Why are we going with Columnar cassandra database to store the messages? we're not doing any aggregation, and also don't we need our data to be consistent as well? would a document nosql database be better
Probably because we need to fetch All the messages from a single conversation. So reading that from columnar db might be fast.
Great video one doubt
let's say when I go online I make websocket connect with chat servicer 1 and do the send thing etc... now I go offline so will that websocket connect b/w me and chat server gets removed and when I go online again so again a websocket connect will be made and this time this connection will be made to some other chat server right?
Generally these connections work in pool, so when you go online a new socket connection will be made for you
Thanks for the nice explanation, can you post video on youtube or any streaming site
sure, I will be coming up with Netflix design soon
Here you go, I hope this will be helpful: ruclips.net/video/NBO88PLGIis/видео.html
You are awesome ...nice way of explaining.well researched content
Thank you. Glad you liked it. Do like and subscribe and share it with your friends :)
One more thing if we don't use websocket protocol here then for each msg we will have to make the connection each time for new msg but with this websocket protocol it will make a connection and both client and server can send the messages.
My friend was asked to make a bot chat system in which a real user will ask the question and the bot will answer it so the design you have explained can I refer the same design for this thing also?
You can use this but In chat bot a simple http will work because there server is not sending a message rather response to your request. If you ask something to a chat bot, an api will look for that question in some knowledge base and return you a response to the question, this is the case with simple chat botS, which does not involve ML
communication between server to server is also over web socket connection?
Yes
@@TheTechGranth thanks a lot for quick response 🙏
@@rational5872 welcome. Do like and subscribe and share with others 🙂
Fantastic explanation !!
Glad you liked, hope it was helpful :)
@@TheTechGranth yes
@@rajibguha6960 Glad to hear that!!!
In the above scenario user2 web-socket connection resides in server S4, so when user1 send message it is received by server S1. How server S1 communicate with server S4 ?
As part of your application, you will query redis to get the websocket connection for the receiver. From redis you know which machine holds the connection object, make a call to that machine to get the object. Btw your application shoould have an internal getter which will share the connection object stored in map.
if a connection object could be shared among servers using Redis, why do we need to be linked to specific server then? can we simply put connection object in Redis cache itself and doesn't store any user-server mapping tables then?
I don't think its possible to share connection using Redis, and there's should be simple API endpoint which allows server1 forward user's message to server2
What is the purpose of second table (on right side of the screen) at around 28 mins
That is the hashtable which contains userid and its websocket connection object
But can’t we use the table on top left?
@@ameynaik2743 that is to identify on which server a user connection os present, you can serialize and store this data in 1st table as well, I chose to store on local server in hashtable
Is websocket over tcp?
Yes
The system can't have both consistency and availability.