-1

I am hoping to use Firebase FCM for the following scenario but do not know if it is feasible:

A reasonably large number of users (100000+) subscribe to one of a fixed number of topics (around 10000) for a very short duration (1-5 minutes) before unsubscribing and subscribing to another topic. Each user only subscribes to a single topic at any one time and for the short period that they are subscribed to each topic, I can send messages to all subscribers almost immediately after they subscribe.

Is this practical?

Are subscriptions / unsubscriptions handled in near real-time?

Is this better handled another way such as sending by registration id and handling the 'topic' myself?

Paul Hiles
  • 9,558
  • 7
  • 51
  • 76
  • 1
    *not the downvoter* Hi Paul. This could be very broad. Subscriptions/unsubscriptions are handled *as soon as feasible*, which is the case for FCM processes in general. Depending on your use-case, it may be more advisable to go with using [Firebase Realtime Database](https://firebase.google.com/realtime/database) instead. – AL. Mar 20 '18 at 04:37
  • Thanks for the suggestion. Looks interesting. I have read the docs regarding FCM and know that performance is best effort. I was just looking for someone's real-world experience to give me a more definitive time period for topic subscriptions (i.e. although it says best effort, it typically takes less than x seconds) – Paul Hiles Mar 20 '18 at 13:19
  • Time period wise, I haven't really encountered any delay with the subscriptions/unsubscriptions before, provided that the device is sure to have a decent network connection. – AL. Mar 20 '18 at 15:33

1 Answers1

-1

First question - why do you have 10000 topics?? Even with a single device having that it wouldn't be manageable. Is this practical? No. Are subscriptions/unsubscriptions handled in near real time? No, that is not how subscriptions work. Last q's ans => https://stackoverflow.com/a/44934299/8525451 [doing it via registration_ids]

supro_96
  • 570
  • 6
  • 14
  • FCM offers an unlimited number of topics and an unlimited number of subscribers per topic so not sure why 10000 topics would be unmanageable. My situation is a game with 10000 locations. Users can be in one location at a time and when in that location, they receive updates based on other users activities within that location. This seems reasonable but depends on the speed at which users can be added to/removed from topics which I cannot find from the docs. – Paul Hiles Mar 20 '18 at 13:11
  • Well, my point was FCM can't solve your problem fully. You could switch to OneSignal,pusher,pushcrew etc and *Firebase doesn't guarantee the delivery of a message* So, be very careful with that. – supro_96 Mar 21 '18 at 06:28
  • @Supradip.M Hi. Could you point me out to where you saw the "*Firebase doesn't guarantee the delivery of a message*"? If it's in the docs, it should be edited. AFAIK, what was only stated was "*Firebase doesn't guarantee the **order** of delivery..*" – AL. Mar 21 '18 at 10:46
  • @AL. Order of delivery is what is in the docs, so don't worry about that. Practically speaking I could put n links on many people having issues with FCM i.e. not receiving messages. It's a painful problem. So, with Paul Hiles having that many users and topics. Theoretically, we can see a possibility but I doubt the project will work like it's supposed to. – supro_96 Mar 22 '18 at 04:25
  • I'm passionately familiar with FCM, on how it works and the problems encountered by most users. However, mentioning that "*FCM doesn't guarantee delivery*" may confuse others. – AL. Mar 22 '18 at 05:40