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".
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.
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.
Realtime database shardingYou can use up to 1000 instances at the same time, thus reaching incredible scalability.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With