I've developed an app for clients that requires immediate delivery of notifications. It worked flawlessly during our testing phase with just 5 users, but as we've expanded to around 30,000 users, we're facing significant delays, with notifications arriving 5 to 10 minutes late. Currently, I'm using Firebase Cloud Messaging (FCM) for the notification system, which limits us to OS-level push solutions (FCM for Android and APNs for iOS). I'm curious how apps like Telegram manage to deliver notifications instantly, even when the app is not running. What strategies can I employ to achieve similar speed and reliability in my app? By the way, I've set the highest priority in my current FCM requests: android.priority = "HIGH" and apns-priority: 10.
2 Answers
Batching notifications is a smart approach. You can use something like NATS to queue and process messages in batches, pushing them out through a specialized service written in a language like Go. This way, you can send multiple messages concurrently, which should help cut down on those annoying delays. Remember, efficiency is key!
You might want to consider using a message queue system like Kafka or NATS, which can help improve delivery speed by handling push notifications in parallel. These systems can maintain an open connection and listen for incoming notifications without being hindered by the OS-level push infrastructure. If you want to cover all bases, integrating SMS or email could also be a fallback for critical alerts.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically