Firebase simultaneous realtime connections to my database

14,717

Solution 1

The FAQ has an item that explains what a connection is:

A simultaneous connection is equivalent to one mobile device, browser tab, or server app connected to the database. Firebase imposes hard limits on the number of simultaneous connections to your app's database. These limits are in place to protect both Firebase and our users from abuse.

The Spark plan limit is 100 and cannot be raised. The Flame and Blaze plans have a limit of 200,000 simultaneous connections per database.

This limit isn't the same as the total number of users of your app, because your users don't all connect at once. If you need more than 200,000 simultaneous connections, please read Scale with Multiple Databases.

Solution 2

i made an inquiry with Firebase support to understand what the steps to increasing the max simultaneous connection count are, or to at least understand how they determine who is eligible for an increase. granted, 100,000 simultaneous connections is likely a very hard limit to breach, i suspect they are reluctant to do this easily for the simple fact that despite a three email back-and-forth in which i was very clear and direct with my questioning, i never got answers to my questions.

instead, the two recommendations i consistently got were to either:

  1. shard your data. per the docs (emphasis mine):

A simultaneous connection is equivalent to one mobile device, browser tab, or server app connected to the database. This isn't the same as the total number of users of your app, because your users don't all connect at once. For example, apps with 10 million monthly active users usually have fewer than 100,000 simultaneous connections. Your max simultaneous connections depends on your total user count and the average time users spend in your app.

However, if you need to scale beyond this limit, try using multiple databases.

  1. try Cloud Firestore as it will support automatic scaling (emphasis mine):

Scaling will be automatic.

Scales completely automatically (after beta), meaning you don't need to shard your data across multiple instances.

Share:
14,717
Ron
Author by

Ron

Updated on June 14, 2022

Comments

  • Ron
    Ron about 2 years

    I have the free plane in Firebase - I have 100 simultaneous realtime connections. But I didnt understand one thing: Now, No one connected to my app, and in Firebase - It is written that I have 3 connection. What that mean? I have 100 connections in general or maximum 100 simultaneous realtime connections?

    I would love someone to explain to me how it works.

    thanks