Questions before implementing Firebase Topic Messaging ( Push Notifications )

1,486 views
Skip to first unread message

Harsh Shah

unread,
Apr 4, 2020, 11:10:42 AM4/4/20
to Firebase Google Group
We love Firebase Messaging and heavily use all the features. Sorry for the long email. Hopefully the team is safe and wish you and the team good health.

Some of the apps which use our SaaS Product have around ~450 Million Android + iOS users(99% Android). Currently we send these users push notifications via the /fcm/send API endpoint.
It takes us around ~30 minutes to send them push notifications since we send them in a batches of 1000 each per API call.

We have started exploring Topics(https://firebase.google.com/docs/cloud-messaging/manage-topics) wherein we can register all of our tokens under a single topic and using a single API call send a push notification to all the users.

This would be really great. Before we start to implement, we wanted to know more(5 questions) regarding topic based push notification delivery.


1. Is there a software upper limit to the number of push notification tokens that can be registered to a single topic like 1 Billion?

2. How do we get the count of Delivered, Error push notifications when we send push to a specific topic ? Currently the API returns a "message_id [{"message_id":4420761896999908368}]. Is there a way to fetch these stats like status of each and every push notification token which was attempted. From our research, we understand FCM Export to BigQuery and obtaining the numbers from BigQuery is one way to do these. Alternate approaches would be helpful here.

3. Is there an API which can tell us only the Sent and Error count based on the message_id which is returned in the topic API response ?

4. On the topic of reliability, is both sending push notifications via push tokens ( instance ids) vs topics have the same performance/reliability ? Or is topics due to its functionality towards throughput as opposed to latency more probable to drop some tokens for delivery when compared to targeting specific tokens ?

5. For Topic based messaging, we see a Fanout throttling rate of 10,000 QPS. Wanted to understand more here with specific examples. Does this mean it can send 10,000 multiply by 1000 tokens per batch = 10 million push notifications per second ?

Adding some use-cases here which will help us make the decision.

Scenario A : How long would it take to cycle through a topic which has 500 million push notification tokens. Want to know how fast would these pushes be delivered assuming all the devices are in foreground with great internet connectivity and no background restrictions. Answer here would help us establish a string benefit to migrate to topic based messaging as opposed to token based.

Scenario B : A news app has 6 topics for 6 languages sends a Breaking News push notification by calling all the 6 topics. Each topic has around ~10 million tokens. How much time would it take to make all these 60 million devices eligible for receiving push notifications again assuming no device level limitations.

Scenario C : We have time sensitive Apps as wherein a TV Programme like the Prime Minister's speech is supposed to start at 6 pm and it needs to be sent to 100 Million users for tuning in as they have subscribed for the same. If the speech is supposed to start at 6 pm, is it a good scenario to send a topic push notification request at 5:58 and assume the push will be delivered.
Also if there is another push which needs to be delivered at 6:02 based on some declaration made in the speech, how would Fanout throttling affect the delivery. Some counts here would help.


Please do let us know if you need clarifications on any of the above questions.

Kato Richardson

unread,
Apr 6, 2020, 6:05:52 PM4/6/20
to Firebase Google Group
Hello Harsh,

> 1. Is there a software upper limit to the number of push notification tokens that can be registered to a single topic like 1 Billion?
There's no such thing as infinite scale, so yes there is a hardware limit. If there were a known limit, it would be documented. Hint: Nobody is sending 1 billion of anything to anyone yet.

> 2. How do we get the count of Delivered, Error push notifications when we send push to a specific topic ?
Delivery rates are posted in the FCM usage info. BigQuery for more details like topic fanout.

> 3. Is there an API which can tell us only the Sent and Error count based on the message_id which is returned in the topic API response ?
No.

> 4. On the topic of reliability, is both sending push notifications via push tokens ( instance ids) vs topics have the same performance/reliability ?
Neither drops tokens for fun. Neither has an SLA. They shouldn't be functionally different in reliability.

> 5. For Topic based messaging, we see a Fanout throttling rate of 10,000 QPS.
It means 10K queries per second. To send a million, you need at least 1K seconds, not counting overhead of fanout and recipient filters.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/94371d5b-97b3-401e-b708-e92ffc9463f2%40googlegroups.com.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Harsh Shah

unread,
Apr 9, 2020, 4:24:37 PM4/9/20
to Firebase Google Group
Thanks Kato. Appreciate it. Will circle back here in case I have more queries once we test this out.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.

minheinkyaw 97

unread,
Apr 9, 2020, 4:56:24 PM4/9/20
to fireba...@googlegroups.com
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/53cd9841-5b91-4106-9a70-895939d72e21%40googlegroups.com.

Mehedi Hasan

unread,
Apr 11, 2020, 10:55:25 AM4/11/20
to fireba...@googlegroups.com
Hi Harsh,
We have been using both topics and token based messaging for some time. One real life finding is, sometimes Topic messaging starts to lag and we can not explain that why.  We had posted that event here. You can check:



One small query to you. You have mentioned that it takes 30 mins to send notification to 450M customers in 1000 tokens per API. But 450M/100 is around 12.5 hours. How did you achieve 30 mins? Multi-threading or multi instance or asynch mechanisms? 

Harsh Shah

unread,
May 22, 2020, 9:59:06 PM5/22/20
to Firebase Google Group
Yes, we send in batches of 1000 ( non-personalised) instead of 100 and yes multiple concurrent threads solves it for us.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fireba...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages