Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Scalability Limit

This post says that FireBase will have an issue coming when an individual node begins to have 1-10+ million children. How should one handle Users in an app if we have more than 10 million? In all the examples I though Users were simply children of a single node "Users".

like image 564
Ronen Rabinovici Avatar asked Nov 16 '15 22:11

Ronen Rabinovici


People also ask

How much scalable is Firebase?

Additionally, the API functions of firebase are designed in order to scale linearly with the size of data being synchronized. It handles the scaling operations. Your application will scale from its first user to its first million user without any change in the code.

Can Firebase handle 10 million users?

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.

Is Firebase Realtime Database scalable?

Realtime database shardingYou can use up to 1000 instances at the same time, thus reaching incredible scalability.

Is Firebase good for large users?

Conclusion: If you're building something cool and needs a fast, reliable database, user authentication and usage tracking, then Firebase is a great way to go. Not recommend for complex project. Large application, very few people use serverless, if you do not want later to pay expensive to sit back.


1 Answers

Firebase is not ideal for processing long lists of items. The problem with these long lists is not so much storing the data as it is accessing the data.

Whenever you access the list (e.g. ref.child('users').on(...) Firebase has to consider all items in that list on the server; even when you are only downloading a few users (.limitToLast(10)), it has to consider each user.

But as long as you never try to access the list, you can store as many users under there as you want. But that means that you always access them directly, e.g. ref.child('users').child(auth.uid).on(....

This limits the use-cases you can implement, so typically developers create sublists of users by how they need to use them. For example if each user is keeping a list of friends, you could keep those like ref.child('users_friends').child(auth.id).on(... and look each of them up with ref.child('users').child(auth.uid) again. That way, you're only reading a small list of users and then loading each of those users directly.

like image 186
Frank van Puffelen Avatar answered Oct 19 '22 00:10

Frank van Puffelen