How does YouTube handle millions of video notifications at once, while Discord can barely send out a couple thousand @everyone?

135 views

How does YouTube handle millions of video notifications at once, while Discord can barely send out a couple thousand @everyone?

In: 13

4 Answers

Anonymous 0 Comments

One thing I would add, is that YouTube notifications might be triggered by a Client Side query, meaning the code when you refresh or open a new page says “Hey YouTube, can you look up my list of notifications and tell me if there are any new ones?”, which spreads the load of the notifications around over time because people are refreshing at different times (aka YouTube doesn’t know about the notification until you ‘ask for it).

Discord could be a Server Side push, since it’s built around being more of a real time communication system, so the Server has to look up each Client that is active, and tell them about the notification the moment it happens (which is much harder to split between multiple Servers and make sure nobody gets missed or nobody gets the same notification twice).

The difference is that YouTube is effectively a Client side Pull, and Discord is a Server side Push. Client side Pulls might be a lot of work for the Server to determine each Pull individually, but it’s easy to spread out over time and much easier to have multiple Servers that can answer questions about relatively static data.

Again totally speculative, because we don’t know their code.

You are viewing 1 out of 4 answers, click here to view all answers.