Prompt
I'm building a startup and need a simple push notification infrastructure
Latest observation
Oct 14, 2026
OpenAI APIWeb search: off
Here’s a simple, startup-friendly push notification infrastructure you can build without overengineering it.
1) Core idea
Use a small backend service that:
- stores user/device push tokens
- accepts notification requests from your app/backend
- queues jobs
- sends to APNs (iOS) and FCM (Android/Web)
- tracks delivery/invalid tokens
2) Basic architecture
Components
-
Client apps
- iOS app registers with APNs
- Android app registers with FCM
- Web app can use FCM Web Push
- app sends device token + user ID to your backend
-
API backend
- endpoints to register/unregister tokens
- endpoint to create notification requests
- auth, rate limiting, validation
-
Database
- users
- devices
- notification requests
- delivery logs
-
Job queue
- Redis + BullMQ / Sidekiq / Celery / SQS
- async sending so your API stays fast
-
Notification worker
- pulls jobs from queue
- sends to APNs/FCM
- retries transient failures
- marks bad tokens inactive
-
Provider services
- Apple Push Notification service (APNs)
- Firebase Cloud Messaging (FCM)
3) Minimal data model
devices
iduser_idplatform(ios,android,web)push_tokenenabledlast_seen_atcreated_at,updated_at
notification_requests
idtypetitlebodydataJSONtarget_user_idor segment fieldsstatus(queued,sent,failed)created_at
notification_deliveries
idnotification_request_iddevice_idproviderprovider_message_idstatuserror_codecreated_at
4) Main flow
Device registration
- app gets push token from APNs/FCM
- app calls backend:
POST /devices - backend stores token and device metadata
Send notification
- backend creates a notification request
- enqueues a job with target users/devices
- worker resolves device tokens
- worker sends via APNs/FCM
- worker stores success/failure and disables invalid tokens
5) Suggested MVP tech stack
Keep it boring and cheap:
- Backend: Node.js (NestJS/Express) or Python (FastAPI/Django)
- Queue: Redis + BullMQ (Node) or Celery (Python)
- DB: Postgres
- Push providers: APNs + FCM
- Hosting: Render/Fly.io/AWS ECS/Lambda
- Monitoring: Sentry + basic logs + metrics
6) API endpoints
Register token
POST /devices
{
"user_id": "123",
"platform": "ios",
"push_token": "abc123",
"app_version": "1.0.0"
}
Remove token
DELETE /devices/:id
Send notification
POST /notifications
{
"target_user_ids": ["123", "456"],
"title": "Welcome",
"body": "Thanks for signing up!",
"data": {
"screen": "home"
}
}
7) Important operational details
- Deduplicate tokens: same token may re-register
- Handle token rotation: devices change tokens over time
- Disable invalid tokens after APNs/FCM rejection
- Retry transient failures with exponential backoff
- Batch sends when possible
- Log provider errors for debugging
- Keep payloads small
- Respect user preferences and opt-outs
8) Multi-tenant / segmentation later
If you need segments later, add:
- tags
- locale
- timezone
- last_active_at
- subscription preferences
Then you can support:
- all users
- active users
- paid users
- users in a region
- event-triggered messages
9) If you want the simplest possible version
You can even start with:
- a single table of devices
- a
send_notification()endpoint - one worker process
- direct APNs/FCM sending
- no fancy segmentation or analytics
That’s enough for an MVP.
10) Build vs buy
If you want to move fast, consider:
- OneSignal
- Braze
- Firebase Cloud Messaging only for Android/Web
- AWS SNS for a more infra-heavy route
Build your own if you need:
- lower cost at scale
- custom workflows
- better control over user targeting
- fewer vendor dependencies
If you want, I can also give you:
- a concrete database schema
- a Node.js or Python implementation
- a production-ready AWS architecture
- a build-vs-buy recommendation for your startup stage