purush
purush

Reputation: 569

Firebase simultaneous connection limit if adding more listeners

Our firebase realtime database is reaching it's 100k connection limit.

We have a object with some 30 keys some of them are int & float and are updated more often while the other are string which are updated less frequent.

Right now we fetch the whole node but I'm thinking of dividing the object in 2 parts.

1.one for more often updated but less in size data. 2.Second for less frequent updated, larger in size data.

So we can reduce the database usage.

The question is will the simultaneous connections increase to double? as there will be now 2 listeners instead of 1?

Upvotes: 2

Views: 662

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317497

The number of connections to Realtime Database is almost certainly not going to be related to the types of data you're storing, or the way that data is organized.

Every mobile client establishes exactly one websocket to Realtime Database, and that socket is only active when the app is running in the foreground (and maybe a bit outside of that in some cases). That socket is considered a single connection, and all traffic between the database and the client go over that socket. It doesn't matter what data is being transferred - there is only that one socket.

Don't confuse listeners with connections. All added listeners/observers in an app use the same socket. Reducing the number of listeners will not reduce the number of connections.

Upvotes: 5

Related Questions