Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inexpensive firebase listeners

I am curious to know what is the internal implementation of firebase listeners like?

I have heard firebase engineers saying firebase listeners are inexpensive to use and can be used as much required. While I agree that they make the app real time. What happens if I have a bunch of firebase listeners in my app(a real time chess playing application for multiple users.)

The listeners are listening to bunch of actions including when a move is made by a player in a game or when a new game is started. Easy to imagine the scale if I have hundreds of thousands of users using the application concurrently everyday.

How does firebase handle so many requests on their server since they have given the power of listeners to the end user.

We can have as many listeners as we want in our firebase app. How is this inexpensive?

Please correct me if I am wrong in my inherent assumptions.

like image 572
Rohan Dalvi Avatar asked Jun 04 '16 22:06

Rohan Dalvi


People also ask

How do I reduce the cost of Firebase?

The simplest way to reduce the cost is by reducing the downloads. You can do that by caching the data on local storage as much as possible and continuously sync sensitive data.

How many users can firebase handle for free?

Show activity on this post. The limit you're referring to is the limit for the number of concurrently connected users to Firebase Realtime Database on the free Spark plan. Once you upgrade to a payment plan, your project will allow 200,000 simultaneously connected users.

Can firebase handle million users?

Queries with limited sorting and filtering functionality can be performed with the firebase database. Cloud firestore assures automatic scaling and can handle 1 million concurrent connections and 10,000 writes/second.

Is firebase firestore expensive?

Although Firestore is very affordable with little usage, costs start to increase as you begin to scale. In most cases, the cost of using Firestore at scale is more expensive than other providers.


1 Answers

Firebase uses WebSockets, which is a persistent connection to the server. This means that you don't have to worry about making a request, because the only HTTP request that gets made is in the very beginning to establish the socket. Here is more information about Web sockets which is a different protocol from HTTP. So in your case it's completely feasible to make many separate "requests" for the data, because there's no real overhead to consider. The device's radio is already on, and a WebSocket header is merely 6 bytes.

like image 112
Parag Kadam Avatar answered Oct 16 '22 23:10

Parag Kadam