We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
4 system design questions lean on this idea. Each walks through the full answer.
System Design Masterclass · Messaging Event Systems
Free preview: the first 2 parts of this 6-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Messaging Event Systems
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Every other messaging pattern we've covered assumes the user is actively connected to your application. Polling, long polling, webhooks, they all require an open connection or an active session.
But what about when the user has closed your app? When their phone is in their pocket, their laptop is asleep, or they switched to a different browser tab three hours ago?
That's where push notifications come in. They're the one messaging pattern that can reach users even when they aren't actively using your product.
Uber sends you a push when your driver arrives. WhatsApp sends one when you get a message. YouTube sends one when your favorite creator uploads. Duolingo, well, Duolingo sends them when you haven't practiced, when you almost practiced, when someone you've never met practiced, and when the owl is disappointed in you.
Push notifications are absurdly powerful for engagement. They're also absurdly easy to abuse. The companies that get them right see 3-10x higher retention. The companies that get them wrong get uninstalled.
Push notifications aren't one technology. They're three separate ecosystems that happen to serve the same purpose:
Mobile push (APNs + FCM):
Web push (Web Push API):
The flow is the same for all three:
One design choice explains all three ecosystems. If every app maintained its own persistent connection to its server, a phone with 50 apps would need 50 open connections, destroying battery life. Instead, the device maintains a single connection to Apple or Google's push service, which multiplexes notifications from all apps over that one connection. Battery life stays reasonable. Your server talks to the push service, never directly to the device.