Push Notification Infrastructure: The Complete Guide for Developers
How push delivery actually works end-to-end, why FCM is only the transport, and the seven responsibilities you inherit the moment notifications matter.
Most guides about push notifications stop at the SDK snippet. That's the part Firebase makes easy — and it's why so many teams discover, mid-incident, that they shipped a demo, not a system. This guide covers what actually happens between "your code calls send()" and a notification appearing on a phone in another timezone, and the operational machinery nobody puts in the tutorial.
I've spent 15+ years building backends in payments and banking, where "the message didn't arrive" is an incident report, not a metric. I now build QueueFly, which is what I wished existed the first ten times I rebuilt this from scratch. This guide is vendor-neutral first — the product angle comes last, honestly labeled.
How push delivery actually works
Every push notification travels the same path, regardless of what anyone's marketing page says:
- Registration. The app asks the OS for a device token — from FCM (Android/web), APNs (iOS), or both. The token is opaque and not stable: reinstalls, restores, and internal cache pressure rotate it.
- Your server → platform gateway. You send an authenticated HTTPS request to FCM's or APNs' gateway, addressed to that token.
- The gateway → device. The platform delivers when the device is reachable — which it controls, not you. Doze modes, battery optimization, OEM throttling (the aggressive Chinese ROMs are infamous), and user-granted permission states all sit in this hop.
- Display. The OS renders the notification payload, or your app handles a data message.
Two truths fall out of this. First: there is no alternative to the gateways for mainstream delivery — every vendor in this comparison rides them. Second: the gateway is a transport, like an SMTP relay. Everything that makes transactional email a discipline — queues, retries, bounce handling, suppression lists — has an exact push equivalent, and FCM gives you none of it.
The seven responsibilities you inherit
This is the part the SDK tutorials skip. The moment notifications matter to your product, you own:
1. Token lifecycle. Tokens change without telling you; the only signal is a delivery failure (UNREGISTERED on FCM). You need a way to map users ↔ many tokens, prune invalid ones, and stop sending to them. The full mechanics get their own guide in this series — short version: it's a cron job that never ends.
2. Retries with backoff. FCM returns transient errors too: UNAVAILABLE, INTERNAL, rate-limit THROTTLE responses (X-FCM-Ratelimit-* headers). A single send() call with a try/catch is not a retry policy. You need exponential backoff, a ceiling, and a decision rule for what's transient vs. terminal.
3. Scheduling and timezones. "Notify at 9am local" means resolving each user's timezone, storing a future intent, surviving deploys between now and then, and re-checking token validity at fire time. DST transitions mean a naive cron fires twice or zero times, twice a year, somewhere.
4. Fan-out and throttling. Sending to one token is an API call. Sending to a million is a throughput engineering problem: per-project quotas, worker pools, and the difference between topic messages (batched by the platform, capped at ~20M topics) and per-device sends (your problem entirely).
5. Failure disposition. After retries fail, where does the message go? Without a dead-letter pattern, your only observability is a log line nobody reads. A DLQ means failed sends stay queryable: why it failed, when, and what happened next.
6. Delivery observability. "Sent" from your code ≠ delivered to the device ≠ displayed ≠ opened. FCM's HTTP response tells you the gateway accepted the message — that's the first fact, not the last. Answering "did user 42 get their 2FA code at 14:03?" needs a journal of sends you can query later.
7. Multi-tenancy (if you have more than one app). Credentials, quotas, tokens, and analytics that leak between apps is an outage pattern. Isolation has to be designed in, not bolted on.
Notice what's missing from that list: the send call itself. That's the ~5% Firebase gave you for free. The other 95% is the actual product of notification infrastructure — and it's the same 95% whether you're sending order updates or security alerts. (The reliability profiles differ, though — the alternatives guide covers when to reach for a platform vs. a queue layer vs. raw transport.)
Build, buy, or wrap: the honest decision
Build it if notifications are core IP, you have platform engineers on staff, and you enjoy owning worker pools at 3am. Budget for the long tail: token cleanup drifts silently, dead-letter parking rot without inspection tooling, and your scheduling table becomes someone's on-call rotation.
Buy a platform (OneSignal-class) when marketing owns notifications: segmentation, journeys, A/B campaigns. You're paying for the engagement suite; the delivery plumbing rides along, metered by monthly-active-users.
Wrap FCM with a queue layer when you've decided the transport is right but the 95% is drowning you. This is the lane I chose with QueueFly — be aware that means I'm the vendor for this option, so weigh it accordingly:
- You keep your own Firebase credentials; the layer sits on top — no transport swap, no data migration, no lock-in beyond a REST endpoint.
- The seven responsibilities above map to shipped features: auto-registration and rotation for tokens (plus an invalid-token webhook), exponential-backoff retries, UTC-timestamp scheduling with cancel-before-fire, auto-scaling fan-out, a dead-letter park that holds persistently failed sends, a queryable journal (
POST /api/v1/push/sent, batches up to 2,000 ids), and tenant isolation as a first-class concept. - Pricing is flat by registered devices with unlimited sends — spiky traffic is exactly what per-message pricing punishes.
- Zero-retention by design: message content is nulled the moment a notification is processed, so the delivery record survives and the payload doesn't.
And the honest anti-pitch: if push is decorative for you, volume is low, and you have spare cycles — raw FCM genuinely is the right answer, and none of this guide's machinery will hurt you yet. Many teams also run both a marketing platform and a transactional path, because those workloads want opposite things.
What "good" looks like (checklist)
Whatever you choose, hold it to this: every send has an id you can query later; every failure has a disposition you can inspect; token invalidation produces a signal, not silence; scheduling survives your deploys and the DST boundaries; volume changes don't require config changes; and no vendor owns your device data. If your current setup fails any of those, you're running the 95% on hope.
This is the pillar for the notification-infrastructure cluster: start with the 7-way service comparison or what "FCM alternatives" really means, and the machine-readable API reference lives at /docs/api-reference.md.