Тёмный

Find Nearby Friends | System Design 

Code with Irtiza
Подписаться 12 тыс.
Просмотров 4,4 тыс.
50% 1

Let’s look at how you can design a Nearby Friends feature similar to Facebook. We talk about web sockets, Redis caches, channels, and databases like MySQL and Cassandra!
System Design Interview Book:
www.amazon.com/System-Design-...
System Design Playlist: • System Design Beginner...
Notes from the video:
pdfhost.io/v/aHImDZGO4_Find_N...
🥹 If you found this helpful, follow me online here:
✍️ Blog: / irtizahafiz
👨‍💻 Website: irtizahafiz.com
📲 Instagram: / irtiza.hafiz
00:00 Announcements
01:28 Features
02:11 High-level Design
04:00 WebSockets
06:42 Calculate Scale
08:18 Redis Channels & Kafka
10:30 Use Redis Channels to push updates to clients
13:50 Location Updates using Redis Channels
16:22 Caches for User Location
18:40 Finding offline & far away friends
19:44 Database for persistent storage of location data
21:20 Cassandra Database
24:15 Final Review
26:40 Outro
#systemDesign #interview #programming

Опубликовано:

 

4 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 20   
@JemilOyebisiDeveloper
@JemilOyebisiDeveloper 2 года назад
Great content as usual, great job 💪🏾
@irtizahafiz
@irtizahafiz 2 года назад
Thank you so much for staying connected and watching more! I am in the middle of a move, so there is a lack of content right now. Will get back uploading very soon.
@ayeshasiddiki916
@ayeshasiddiki916 2 года назад
Very helpful! Thank you 🙏🏻
@irtizahafiz
@irtizahafiz 2 года назад
Glad it was helpful!
@boyanlin873
@boyanlin873 6 месяцев назад
One main question I have about this approach when you subscribe friends to the redis channel, is that when the friends isn't online and isn't connecting to a socket server, how can you let the friend subscribe to the redis channel? I know that you can use command in redis specifying "subscribe channelA" from a socket server, but for a friend who isn't online yet when the channel is created, and came online later on, how do we let that friend subscribe to this channel? Specifically, userA is online, creating a channelA, where userA's friends B, C, D are also online, so they are subscribing to channelA right away. UserA also have friend E, F, G who aren't online right now. ChannelA also added them as subscribe (I don't know how we technically do this part). 5min later, E came online and connect to the socket server, how does channelA know to push to user E?
@IndianGuy6
@IndianGuy6 2 года назад
How about storing the list of available nearby friends in an inverted list /adjacent lists ? For example : lat, long, timestamp ---> Friend1, Friend2, Friend3
@irtizahafiz
@irtizahafiz 2 года назад
Yeah that might work too!
@veerendrashukla
@veerendrashukla Год назад
when A's friend comes online , how can he update the A's redis cache for him being online? Does that he needs get hold of his friend's radis cache and update all their caches so that they know he is being online?
@irtizahafiz
@irtizahafiz 8 месяцев назад
Hi! It's been a while so I will have to go back and check the video to remember. Hopefully you figured something out by now. If not, feel free to email me.
@boyanlin873
@boyanlin873 6 месяцев назад
What document software are you using for presenting in this video?
@irtizahafiz
@irtizahafiz 5 месяцев назад
Obsidian and Miro.
@lephongvu8873
@lephongvu8873 2 года назад
If we push location update messages to channel, how to make sure those messages will only send to online friends?
@irtizahafiz
@irtizahafiz Год назад
Those messages will be pulled by consumers. If friends are not online for a long time, those consumers should be down. If friends were online a few minutes ago, the consumer should do a check to see the last active status of the friend, before actually sending the update to the friend.
@lephongvu8873
@lephongvu8873 Год назад
@@irtizahafiz I got it, thank for your reply
@user-eq4oy6bk5p
@user-eq4oy6bk5p 2 года назад
What do we store in Redis channel? If user A has 200 friends, do we publish 200 messages to the user A's channel?
@irtizahafiz
@irtizahafiz 2 года назад
No. We publish 1 message in user A's channel. That message gets consumed by every consumer of that user A's channel.
@kodingbae
@kodingbae 11 месяцев назад
@@irtizahafiz but who is the consumer, cant be the client's device connecting directly to the redis server right? but if you make another backend server that act as consumer wouldn't the load in that server still be 14m updates/sec?
@devops_tutor
@devops_tutor 9 месяцев назад
so every user going to have one channel and one subscriber?
@irtizahafiz
@irtizahafiz 8 месяцев назад
The design is at a very high level. Not sure how to answer your question without going through the whole video myself, given it's been a while.
@vedavyasa9542
@vedavyasa9542 7 месяцев назад
channel/topic per user but not subscriber
Далее
Design an Autocomplete System | System Design
19:13
Просмотров 7 тыс.
Introduction to Payment Systems | System Design
40:56
Кто Первый Получит Миллион ?
27:44
Rope climb tutorial !! 😱😱
00:22
Просмотров 4,4 млн
Design An Ecommerce Payment System | System Design
17:46
Design A Scalable Rate Limiter | System Design
24:32
Просмотров 10 тыс.
Design YouTube | System Design
40:20
Просмотров 5 тыс.
Leader Follower Database Replication
16:10
Просмотров 3 тыс.