WhatsApp System Design | FB Messenger System Design | System Design Interview Question

preview_player
Показать описание
Solution for System Design Interview Question - "Design WhatsApp/ FB Messenger or any similar Chat Application"

Prerequisites:

If you like this video, please help us grow by sharing this video with your friends on Facebook, connections on LinkedIn and anyone who can benefit from this.

PS: This is not the real architecture of any such platform. This is my take on how I would answer that problem.

#codekarle #systemdesign #whatsappsystemdesign #system #design #interview #amazon #faang #facebook #whatsapp
Рекомендации по теме
Комментарии
Автор

Of all the system design prep videos, I find Sandeep’s videos to be the most comprehensive. I’ve been interviewing the past month and I ended up with 7 offers with system design interview being my strongest in those. All thanks to code karle videos - I cannot appreciate enough how much of a help those were during interview prep.

ayeshaarzbegi
Автор

Videos by Sandeep are the most comprehensive system design videos anyone can see - The flow of information is smooth, logical and easy to follow. Heartfelt thanks to Sandeep for being one of the best tutors on the net.

raghusrinivasan
Автор

Amazing video. A suggestion: Mentioning about sharding mechanisms, configuration svcs such as ZK, consistent hashing etc. might help clarify the complete picture for a particular service

orkylabs
Автор

Good job. I watched similar videos on the same topic. This is actually the most informative for me. Thank you so much.

ismailcenik
Автор

No doubt the content of video is informative for all the system design enthusiasts but I have few points that I was looking for but was missing .
1. If you could have talked about services interfaces like design of some api's, request and response high level design .
2. If you could have talked about the guess estimates like on requests per min, no of users and bandwidth consumption and how we can optimize on those points .
3. Clear cut explanation of why we used Kafka as it's a fancy term and what's the actual use case why not simple and lightweight messaging components if at all we require like active mq .
4 . Some deep dive on internals of redis how we use in this use case .
5 . How we can handle failure scenarios as they can be many in such an interconnected system.
6. Some internals of database design, concepts of indexing, sharding, partitioning as there would be lot of read/writes .

abhisheksinghal
Автор

Love your content, esp because you capture a lot of breadth for all problems. I don't think 64k limit is true on the server side. The server is always listening on a single port and supports simultaneous connections by accepting connections on a different socket. So for a server, the number of file descriptors a server can create is the limiting criterion AFAIK

trybeingakr
Автор

You are PRO. Thanks for so many amazing videos. I have seen others video as well on chat system but none can beat you in terms of deep knowledge, clarity.What a wonderful explainations..

maheshwari
Автор

This is by far the best explanation of WhatsApp messaging system design!

prakashupadhyay
Автор

This is for the first time i landed here and found it so fascinating out of all the system design content... Thank you so much for being here for us ❤️❤️

codewithamir
Автор

since you have mentioned cassandra and redis databases. Sharing sample table structure and queries would surely help us in the visualization of the data and would give us some ideas about the underlying databases as well. But Great Effort in making the concepts very simple

saidattathallam
Автор

By far the best system design videos you can find on YouTube. Amazing how you have so much clarity on these. I would love to have a video on tools like Smartsheet. Thanks in advance.

harshac
Автор

Great information and explanation! As a continuation, here are some thoughts or questions, to help clarify myself.
1. Whenever a group msg is sent, on the client side, a group msg to be shown in the group window, but not in the individual msg window right? to do this, when server is sending group msg to individual users in the group, it needs to tell client that its a group msg
2. May be if data model is defined, showing tables, what fields each table has, the above point can be more clear, not sure how imp it is to describe data model in an interview
3. Last seen service could get info from "Web Socket Manager' from the previous diagram, as it knows which is user is connected to which handler, the moment a user loses connection, this service can inform Last seen service to stop updating time, right? (SORRY MY BAD, the understanding was wrong! Last seen time is based on when the user is "on the app", not just when he has a "live connection with the server") comment might help others as well
4. How long whatsapp server keeps the connection alive? is it forever until user logs out? or until we kill the running instance of the app on the client side?

sowjanyav
Автор

This is my 3rd comment on your videos. I'm really liking your videos. Thank you so much! Here are my few questions. Please don't mind if you feel these questions dumb. I'm in initial phase of learning. Questions -1. Who decides which user will connect to which web handler? 2. You mentioned in Redis, we'll store 2 things - a) UserId-WebSocketHandler mapping and b) WebSocketHandler-List<userId> mapping . Why b is required? 3. What if WebSocket Handler machine goes down? What will be the behavior in that case. Do we need to remove mapping in redis and who will do this? 4. Are there chances of loosing the message. Let's say WebSocket machine went down before message was delivered and before message was put in Cassandra. Will their be retry logic from Client. What are your thoughts of using message queue here? 5. Is WebSocket Manager microservice? Is this single point of failure? If this goes down?

abhishekaggarwal
Автор

pretty good Sandeep. I feel you cover more in very less amount of time. I was wondering what your thought process was in having group messaging as separate. You can also think of direct 1-1 messaging as a group of 2, no ? Also when in case of 1-1 messaging, when you are sending message directly from websocket_handler_A => websocket_handler_B, wouldn't it lead to system crash in case of rush hour ? In short my thought is like handling 1-1 messaging same as group messaging, in this case the async queue can buffer the messages and send with a slighter more delay, instead of a web_socker server crash. Let us know.

Anyways it was fun video dude. Keep posting.

abinvarghese
Автор

This is a great video. It would be great if you could also talk about how message ordering is ensured in case of FB messenger. I doubt it can solely happen on basis of timestamps (client/server), since depending on where users are and the timezones they are in, they might have different timestamps value. This is typically done through messageID's generated by client. You did pick up that, but that can be used for ensuring a consistent ordering of messages is missed. Please do include that as well if you can.

hanspeterpfister
Автор

The best content I have come across from any all the content producers. All the components are explained with necessary technical details which interviewers drill down to and ask questions about. Thank you! Just one comment: Investment in a high-quality microphone would elevate your videos to a whole new level which are already unparalleled. Please keep making them.

maninouri
Автор

Really sad why you didn't receive same number of likes as views:) thank you for teaching such good content for free. I wish I could press the like button 100 times. Great efforts!!

poojabennabhaktula
Автор

Hi Sandeep, want to take a moment to express my gratitude to your video series on system design concepts and scenarios. It was immensely helpful to ace through the system design interview. The system design interview scenario was different but the thinking pattern that I got from your videos helped to have a great dialogue with the interviewer.

vivsiv
Автор

Great video. Some of the issue like 64k limit is already pointed out in other comments. In the last you talked about decreasing the lag in kafka by adding more consumer. I guess you must be talking about adding more consumers in a consumer group but unfortunately it won't help once the count exceeds no of partitions. Excess consumers would sit idle in this case.

shubhamsrivastava
Автор

Thank you so much for this wonderful video. I have a question. Isn't the web-socket manager a single point of failure? If it briefly goes down, how will it know the scope of the existing web-socket connections on the handlers?

srtvenkat