19: Notification Service | Systems Design Interview Questions With Ex-Google SWE

Ғылым және технология

How'd they get a screenshot of my phone for the first slide of the video?!?! I blame Russia

Пікірлер: 42

  • @idiot7leon
    @idiot7leon2 ай бұрын

    Brief Outline 00:00:59 Notification Service 00:02:12 Problem Requirements/Capacity Estimates 00:03:56 Fan Out Design Pattern 00:06:38 Idempotence 00:08:17 Idempotence Continued 00:11:17 Idempotence Continued 00:12:16 Bloom Filters 00:14:15 Client Connections to Notification Server 00:16:56 Final Diagram - Notification Service Thanks, Jordan~

  • @maxvettel7337

    @maxvettel7337

    2 ай бұрын

    Thanks for this work. Really helpful for me

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    Leon is the real mvp

  • @cargoshorts5666
    @cargoshorts56666 күн бұрын

    you seem to actually know what youre talking about, its kind of ridiculous how out of thousands of these types of videos every single other one i've seen is either from ex-swe's that seem like they were only interns with how they've "designed" some systems. sincere thank you this was extremely helpful for creating a notification system for a social app im working on for context my needs are pretty basic/simple, notifications for actions, follows, etc. say a user likes a post, my current approach is 1. create the notification row in the notification table, referencing the action 2. in a sorted set with key "user_notifications": use a batch key as the score and the the id of the notification in the database as the value. the batch key looks like "like_postid". 3. on pull request, get all the values in the sorted set and first using the batch key, batch all things with the same key together and increment a count. using the most recent notification id, get the relevant data and attach it to the notification. 4. store the batched notification data in the database and return the batched notification to the user. the final 2 steps hits redis to get all the ids, then it hits the database and redis again to store the batched notifications, and finally returns it to the user. im not sure if this is a good approach at all

  • @jordanhasnolife5163

    @jordanhasnolife5163

    6 күн бұрын

    sure! just remember, if this is an MVP, no need to build for scale that you don't have to accommodate yet!

  • @cargoshorts5666

    @cargoshorts5666

    6 күн бұрын

    @@jordanhasnolife5163 i know! im just trying to make sure i have the basics covered, because im not sure if my current approach is appropriate

  • @cargoshorts5666

    @cargoshorts5666

    5 күн бұрын

    @@jordanhasnolife5163 i’m also not sure if i should have 2 different tables for notifications (one for batched and one for individual)

  • @maxvettel7337
    @maxvettel73372 ай бұрын

    Ive been waiting for this video. This is one of the basic services

  • @nodemodules
    @nodemodules2 ай бұрын

    My third favourite system design KZreadr just uploaded, sweet!

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    Hell yeah brother

  • @nepo2616

    @nepo2616

    2 ай бұрын

    What are the the other ones?

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    @@nepo2616 Jordan (with a life), and Jordan (with 50% of a life)

  • @spaceofmiah9221

    @spaceofmiah9221

    15 күн бұрын

    Lol 😂

  • @birmaduwakessa2344
    @birmaduwakessa23442 ай бұрын

    Love your videos Jordan! What are your thoughts on creating videos where you build simple projects/programs that implement certain concepts from your systems design playlist? I personally can't find other channels that teach these concepts as well as you, and I feel like doing so would be pretty complementary to your already quality content.

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    Hey! It's definitely something that I've considered - when I run out of shit to do/post in a bit I may turn in that direction :)

  • @kaiqi462
    @kaiqi4622 ай бұрын

    Really appreciate recording and sharing these videos. They are super helpful. For idempotency part, I think we can give each message (per user dimension) one increasing number and keep maximum number on server side. By comparing service and client side's number, we can know if any message is missing or not.

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    Yep!

  • @John-nhoJ
    @John-nhoJ2 ай бұрын

    Jordan - an even better approach to the fanout would be to store the last-sync time with the client and the created_at timestamp for the notification.

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    You'd need that timestamp per flink node as Kafka is only ordered per partition

  • @sudhirreddyemmadi5733
    @sudhirreddyemmadi573315 күн бұрын

    You forgot about 2nd requirement - Offline clients must be able to receive notifications later

  • @jordanhasnolife5163

    @jordanhasnolife5163

    15 күн бұрын

    Throw the notifications to a DB cache per user (so partition based on userId). Same deal as Twitter basically.

  • @harikareddy5759
    @harikareddy57592 ай бұрын

    Jordan, another great video, thank you! Would you be interested in doing the system design of a Google Sheets like application(not the collaboration functionality that you have already covered in Google Docs) but with features more closely resembling Airtable/Causal, focusing on real-time formula application?

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    Hey Harika! I'd have to think about this one a bit, versus whether it's just we have a formula per cell and then it gets applied on all client devices

  • @Rayyankhantheboss
    @Rayyankhantheboss2 ай бұрын

    Hey Jordan, watched all your videos...blah blah blah... great content love it blah blah blah... funny descriptions blah blah blah... now that all the formalities have been taken care of (lol I promise I'm a fan), could you make the OneNotes for all the Sys Design Interview problems accessible as well please? I love going back to the playlist 1.0 powerpoints for concepts, but it would also be really nice to have these oneNote accessible too - ideally in a way I can clone and scribble lotion and tissue boxes on and oh annotate stuff. Willing to send feet pics if you get the job done before my interviews :P

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    Haha - appreciate the formalities. Going to do the actual questions themselves when the series is done, have been punting on the concepts. Have some time today, so I'll have to see if I can clutch up.

  • @ishakalra2089

    @ishakalra2089

    2 ай бұрын

    @@jordanhasnolife5163 +1 to OP. Really love your content and access to slides would be super helpful. Thanks a lot in advance!

  • @TheDEMMX
    @TheDEMMXАй бұрын

    Thanks for the video. How feasible would that be to build reverse mapping at scale? Sounds like expensive operation + at what cadence, we will either spent a lot of compute rebuilding revery sharding or there will be a signiy lag beyey users subscribing and starting to recrcey notifications for that topic.

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Ай бұрын

    I really don't think it would be super significant, we're really just going through a load balancer and into Kafka- and from there we can receive the message in flink and we're good to go

  • @varshard0
    @varshard02 ай бұрын

    Thank you.

  • @rakeshvarma8091
    @rakeshvarma8091Ай бұрын

    Hi Jordan I have a very basic question. Are we building the notification service for all notifications (from all applications) for all users ? In the final diagram, you have mentioned that flink node receives data from 2 sources. 1. Topic subscriptions of user. Basically topic_id --> userId's. 2. Messages from Notification Queue. topic_id --> message. Using above 2 sources, how does the flink sends the real time messages ? Some messages are user specific right for example one to one pings. Sorry if this sounds silly.

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Ай бұрын

    Yeah. I'm not very concerned with one to one pings in this video. If every user is connected to one notification server, we can just figure out where they are connected to and send the message there. In the general case, flink figures out the user IDs the message needs to go to, and via a load balancer/proxy sends it to all of the proper servers which then forward them to users via we sockets

  • @kaiyuanfan8378
    @kaiyuanfan83782 күн бұрын

    Could you explain a little bit more about what flink operator it use to handle this flink mapping?

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Күн бұрын

    Use a MapState on incoming elements and aggregate by key (key is topic, value is list of users subscribed to it)

  • @GopiNathSah-ks4bo
    @GopiNathSah-ks4boАй бұрын

    Jordan, Can you use the bigger mouse pointer, that way we can track, which box you are talking about? Thanks

  • @jordanhasnolife5163

    @jordanhasnolife5163

    Ай бұрын

    I'm using an apple pencil, to my knowledge there is no mouse pointer.

  • @TechPeck-zm9pe
    @TechPeck-zm9pe2 ай бұрын

    Why is the subscription change events topic sharded on user id? I expected it to be on topic id as this stream needs to be joined with the events in notification queue which are also partitioned on topic id

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    See 19:26, typo on my part

  • @surajkumardwivedi7139
    @surajkumardwivedi71392 ай бұрын

    only fans i m 🤣🤣

  • @emilybrowno
    @emilybrowno2 ай бұрын

    Video Editing is too low 👎👎👎👎 Edit the video in a good style. Add nice b-roll animation when you are speaking or explaining something. This will increase visualization. Put proper subtitles, effects, transitions, and colors in the video. Insert the B-Roll (footage and animation) very well because it is absolutely low in your video. Do all this and then see how the video doesn't turn out good. 🍏

  • @jordanhasnolife5163

    @jordanhasnolife5163

    2 ай бұрын

    See duplicate comment

  • @John-nhoJ
    @John-nhoJ2 ай бұрын

    First

Келесі