Send a Message to 1 Million Users in Real-Time

2,301 views
Skip to first unread message

Gijo Varghese

unread,
May 12, 2017, 10:41:44 AM5/12/17
to Firebase Google Group
Hi,

I'm building a Quiz application for a TV show. Once a question is displayed on the TV screen, I've to send the answer options to around 1 million users in REAL TIME. What's the best way to achieve this in Firebase?

Note: There can be around 100,000 - 1,000,000 players and the data to be send it too small, like 4 or 5 words.

1) Option 1:
Using Real-Time Database - Once question is displayed on the screen, I will add the options to database. So all user who have opened the app can see the options.
When I contacted Firebase support team, they told me to use Multiple databases (sharding)

2) Option 2:
Send options as a push notification/message to all users using Firebase Cloud Messaging service (FCM). This one is free right? Will this be 'real-time'? A 1 or 2 second of delay is ok.

Which is the best option? Easy to scale? Best for real-time pushing data?

Frank van Puffelen

unread,
May 12, 2017, 10:44:46 AM5/12/17
to Firebase Google Group
Cross-posted from http://stackoverflow.com/q/43929137/, but it's a better fit here.

Kato Richardson

unread,
May 12, 2017, 6:04:57 PM5/12/17
to Firebase Google Group
Gijo,

100k and 1 million simultaneous viewers are significantly different. One of these is a moderately successful show and the other puts you on par with CSI and Bones (both on the list of most watch shows in U.S. history). They are significantly different for the Firebase RTDB as well.

If you are running one million simultaneous players (note for apps that aren't TV shows reading this: that's probably more like 100 million or 1 billion monthly actives under normal circumstances; TV shows are atypical in this regard), then you should consider splitting that data across multiple databases. Firebase currently caps your simultaneous users at around 100k, and that's realistically about all a single database can support under normal conditions.

If the number of concurrents is realistically under 100k, and you work hard to optimize and really mind your NoSQL data modeling techniques, then a single RTDB instance can be fine here.

FCM can handle the data, but it's not realtime. Keep in mind that there are a large number of moving parts here (Google infrastructure, your servers that sign the FCM requests, carries and isps, and even the devices can delay delivery as they see fit). It will often be in seconds, but you can't depend on that, it will occasionally be minutes or longer.

☼, 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-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/cf8431d5-45d0-4947-9ce5-141a691b086f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

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

Message has been deleted

Gijo Varghese

unread,
May 13, 2017, 9:06:42 PM5/13/17
to Firebase Google Group
Ok. So the best way is to use multiple databases, right?
For e.g.: Since firebase says they can support 100k concurrent connections, if i need to support 1 million users, then i should create 10 databases?

Is there any other good option for this scenario other than firebase?

On Saturday, May 13, 2017 at 3:34:57 AM UTC+5:30, Kato Richardson wrote:
Gijo,

100k and 1 million simultaneous viewers are significantly different. One of these is a moderately successful show and the other puts you on par with CSI and Bones (both on the list of most watch shows in U.S. history). They are significantly different for the Firebase RTDB as well.

If you are running one million simultaneous players (note for apps that aren't TV shows reading this: that's probably more like 100 million or 1 billion monthly actives under normal circumstances; TV shows are atypical in this regard), then you should consider splitting that data across multiple databases. Firebase currently caps your simultaneous users at around 100k, and that's realistically about all a single database can support under normal conditions.

If the number of concurrents is realistically under 100k, and you work hard to optimize and really mind your NoSQL data modeling techniques, then a single RTDB instance can be fine here.

FCM can handle the data, but it's not realtime. Keep in mind that there are a large number of moving parts here (Google infrastructure, your servers that sign the FCM requests, carries and isps, and even the devices can delay delivery as they see fit). It will often be in seconds, but you can't depend on that, it will occasionally be minutes or longer.

☼, Kato


On Thu, May 11, 2017 at 9:04 PM, Gijo Varghese <gijovar...@gmail.com> wrote:
Hi,

I'm building a Quiz application for a TV show. Once a question is displayed on the TV screen, I've to send the answer options to around 1 million users in REAL TIME. What's the best way to achieve this in Firebase?

Note: There can be around 100,000 - 1,000,000 players and the data to be send it too small, like 4 or 5 words.

1) Option 1:
Using Real-Time Database - Once question is displayed on the screen, I will add the options to database. So all user who have opened the app can see the options.
When I contacted Firebase support team, they told me to use Multiple databases (sharding)

2) Option 2:
Send options as a push notification/message to all users using Firebase Cloud Messaging service (FCM). This one is free right? Will this be 'real-time'? A 1 or 2 second of delay is ok.

Which is the best option? Easy to scale? Best for real-time pushing data?

--
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 post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/cf8431d5-45d0-4947-9ce5-141a691b086f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages