System Design Simple
System Design · Likes at scale · Part 2

You tap like. How does your friend's phone know a second later?

Nov 1, 2026 · updated Nov 1, 2026 · 6 min read

Short answer

Your like is saved as an event on a queue. A notification worker decides who should know (usually the post owner). If their app is open, the server pushes it over a live connection; if not, it goes through Apple's APNs or Google's FCM. Many likes are grouped into one notification.

Key facts
Step 1Like saved as an event on a queue
Step 2Worker picks receivers (the post owner) and checks settings
Online deliveryLong-lived connection such as WebSocket
Offline deliveryAPNs (iPhone) or FCM (Android)
Grouping1,000 likes become one notification

You tap the heart on your friend's song. About a second later, their phone buzzes: "Sita liked your song". There is no magic wire between your two phones. Here is the path that like actually takes.

One phone taps like and another phone receives a notification
One tap, one notification on a different phone.

Step 1: the like becomes an event

As in Part 1, your tap is saved as a small event, something like {type: like, post: 42, from: Sita}, and placed on a queue. Saving the like and notifying people are separated on purpose: if the notification system is slow, your like is still saved instantly.

Event pill sliding into a queue card
The like is placed on a queue as an event.

Step 2: a worker decides who should know

A notification worker reads the event and asks one question: who should hear about this? For a like, usually only the owner of the post. For a new post it might be all followers, which is a much bigger job called fan-out. The worker also checks settings: maybe the owner muted likes, or already has a recent notification for this post.

Worker card asking who should know and choosing the post owner
The worker picks the receiver: the post's owner.

Step 3: online phones get it over a live connection

While an app is open, it keeps a long-lived connection to the server, often a WebSocket or a similar streaming connection. The server remembers which connection belongs to which user. If your friend is online, the notification is pushed down that open connection immediately. That is why in-app alerts feel instant.

Green dashed live connection from server to the friend's phone
Online: delivered through the open connection.

Step 4: offline phones go through Apple or Google

If the app is closed, there is no open connection. Apps cannot keep running in the background forever, so phones rely on the operating system's push services: Apple Push Notification service (APNs) for iPhone and Firebase Cloud Messaging (FCM) for Android. The app's server sends the message to Apple or Google with a device token, and they deliver it to the phone when it is reachable. If the phone is switched off, the message waits there for a limited time.

Push service card holding the message while the phone is offline
Offline: Apple or Google hold the message until the phone is back.

Step 5: 1,000 likes become one notification

If your friend's song goes viral, sending 1,000 separate buzzes would be annoying and expensive. So systems group notifications: within a short window, likes on the same post are merged into one message such as "Sita and 999 others liked your song", and the count is updated instead of sending new alerts.

Many notifications collapsing into one grouped notification
Grouping turns 1,000 alerts into one.

Summary

  • Event + queue: saving the like never waits for notifications.
  • Worker: decides who should know (the post owner) and respects settings.
  • Online: push through the app's live connection.
  • Offline: deliver through APNs or FCM.
  • Grouping: many likes, one notification.

A simplified explanation of widely used patterns, not a description of any one company's private systems.

Frequently asked questions

How do push notifications reach a phone when the app is closed?

The app's server sends the message to Apple Push Notification service or Firebase Cloud Messaging with a device token, and they deliver it to the phone.

What is fan-out in notifications?

Sending one event to many receivers, for example notifying all followers about a new post. It is much heavier than notifying one post owner.

Why are notifications grouped?

To avoid spamming the user and to reduce cost: many similar events within a short window are merged into one message with a count.

About the author. Written by a software engineer and system architect with 10+ years of building production web, payment, ticketing and accounting systems in Japan and Nepal. More

Written with AI assistance, then checked and edited by a human engineer. Found a mistake? Tell us.