Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I am making an account system with firebase.
I have the auth part ready.
I also want to store data for every user.
Which database should I use? Firebase Firestore or the real-time database?
Thank you!
I suggest using Firebase Firestore for storing user's data.
You could use Firebase Firestore instead of Real Time Database. As the name suggests, the Real Time database is useful for realtime data sharing. Eg: Sharing Score of one participants to another participants realtime.
Cloud Firestore support indexed queries with compound sorting and filtering. Unlike Realtime Database, Cloud Firestore allows chaining the filters and combining filter and sort on a property in a single query
Realtime Database supports deep queries with limited sorting and filtering functionality. In a single query, you can either sort or filter, not both, on a property
While the Realtime Database is just a giant JSON tree, Cloud Firestore is a little more structured
You can expect to find new query types, more robust security rules, and improved performance with some other advanced features planned for Cloud Firestore
You can set up listeners in Cloud Firestore to stream in changes in real-time
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
What is the cost associated with Azure Cosmos DB? Does the bill depend upon the database or containers we create? Also, does the bill depend on when we read/write data to containers or starts billing from the time we create Azure Cosmos DB? If that's the case, is there an option to disable/pause Azure Cosmos DB Account in Azure?
Pricing for Cosmos DB is described pretty nicely here: https://learn.microsoft.com/en-us/azure/cosmos-db/how-pricing-works. To summarize, you are charged for the capacity you reserved as well as for storage.
To answer your specific questions:
Does the bill depend upon the database or containers we create?
Yes. The moment you create a database or a container with throughput, that capacity is reserved for you so you start paying for that whether or not you use it. Please note that you can create a database without throughput and in that case you're not charged.
Also, does the bill depend on when we read/write data to containers or
starts billing from the time we create Azure Cosmos DB?
Account creation is free. The billing starts when you create a database or a container in that account with throughput.
If that's the case, is there an option to disable/pause Azure Cosmos
DB Account in Azure?
Unfortunately no. You will need to delete the resources to stop the billing.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I have an app that I want to build using Firebase which is basically a chat for users.
There are chat rooms that are temporary, meaning that after each day the rooms (and consequently all the messages) get deleted.
I see a lot of good things about Firestore, but in this case I'll be deleting potentially a lot of messages. Firestore is not only a bit iffy for deleting a bunch of stuff, but also charges for each operation (as I recall I can simply delete a node in rtdb and every children is also deleted).
So which one would be more affordable for my app?
Firestore charges are calculated per READ/WRITE operation performed. So using Firestore for large amount of reads and writes will be significantly expensive than RTDB.
Realtime Database on the other hand calculated just GB of data download and is advisable for storing temporary data in your case, since you will be creating and deleting too frequently.
For more elaboration, check out my answer here. I've also mentioned cons of using Firestore in brief there, it was a similar case.
It will be more affordable to by RTDB resources instead of Firestore if you want to update data too frequently.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
We are building a chat app, one-to-one chatting is the main purpose of the app so for now, messaging speed is our first priority. We need a backend solution and we were initially planning to use Firebase realtime database. But then Firestore came to existence, from there onwards we saw a lot of recommendations for Firestore over Realtime database from the Firebase team.
We have used both Realtime Database and Firestore so we are pretty aware of the capabilities and querying powers of both. For our use case in terms of features, any of them are fine. But as I told before our main concern is messaging speed. So which one is more realtime?
So which one is more real-time?
I don't think one is more real-time than another.
But then Firestore came to existence, from there onwards we saw a lot of recommendations for Firestore
That's right, Firestore has some new features over Firebase Realtime Database, that's why is named "the new flagship". The query performance depends on the number of items you request and not on the number of items you request them from. So every time you think to get data, get it in such proportion to maintain the speed that you were talking about. As the guys from the Firebase team say, Cloud Firestore has a performance guarantee, there are no slow queries, so the time it takes your app to retrieve data depends on only on the amount of data you retrieve and not on the amount of data you have on Firebase servers. In other words, it doesn't matter if you have one thousand, one million, or even one billion documents within a single collection, retrieving for instance 15 of them, will always take the same amount of time.
This performance comes with some constraints and for that, I recommend you take a look at all sections within the official document regarding getting data in Cloud Firestore. That's the reason why Firestore uses those constraints, is due to the fact that is mandatory to maintain this performance guarantee. But from my experience, there is no "SQL" query that cannot be translated in a way or another in Cloud Firestore.
So remember, it really does not matter if you request a single document out of a 10 or one item out of 100.000 or 100.000.000.000, the result will come in the exact amount of time. Here I took as an example one document. So regarding speed, requesting one document out of 100 million will be faster than requesting 10 items out of the same 100 million. So the number of documents in the collection has no effect on the query performance.
This is about Cloud Firestore but there two main resources that I recommend you read before using one or another:
https://firebase.google.com/docs/database/rtdb-vs-firestore
https://firebase.googleblog.com/2017/10/cloud-firestore-for-rtdb-developers.html
So check the price models for each one of them. But IMHO, both Cloud Firestore and Firebase Realtime database work extremely fine together.
In my opinion calculation is simple. Realtime database 10 000 M chat messages data transfer = $490. Firestore 5 000 M reads = $3000 and 5 000 M writes $9000 = $12000. So the cheapest way is to use realtime database and because of $5/GB stored you need each few weeks/months rewrite messages to firestore. For chat app like discord where you have conversation shared with many users the best way is to set a server witch different database like Cassandra.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am developing android and IOS app with web backend admin support for an organisation oriented employee, tasks and issue management system. issues and the task will be posted by any public people and issue will be addressed and solved by the organization people.
my app will have dynamic keyword filtering over the new issue posting and an algorithm will keep running to identify the issue categories dynamically from the issues being posted.
my app or the search result and filters should be fast in retrieving the data and it should not affect my application performance. I didn't know which one is good to use for a case like this.
I use the Realtime database for an large iOS app that contains users, jobs for users, favourites, messages etc. So I need the database to show results in realtime as well as being reliable.
The best features for a big app like the one I have built are the
offline capabilities
If the user goes offline, the database is still responsive and persists data to the disk which resynchronises when connection is established.
Data synchronization
All of my users on the app can see changes happening instantly such as notifications and messages, job updates etc. It's reliable and stops any overlapping potential risk.
https://firebase.google.com/docs/database/
Additionally, it sounds like you will benefit from the easy JSON structure that Firebase Realtime database offers to build categories etc.
I use a lot of filters in my iOS app and the calls to the database return results almost instantly given a connection is established; its very flexible.
In terms of reliability
Cloud Firestore is currently in beta. Stability in a beta product is not always the same as that of a fully launched product, where as Realtime Database is a mature product.
Use Fire-Base Realtime database if your apps are not going to serve more than 1000 people.
Because Fire-base Realtime doesn't perform much complex and fast queries like Fire-Base FireStore. And you can not upgrade your app if your app is based on RealTime database.
FireStore has more features that Realtime database.
You can go and check the difference between both of them:-
https://firebase.google.com/docs/database/rtdb-vs-firestore
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am considering using firebase as a way to brodcast data messages to many connected users on mobile phone native apps running actively in the foreground.
In a "channel" (presumably a node in the database) there might be a new 1kb message every second or so and potentially thousands of users listening in.
The ideal latency should be less than a second.
Is Firebase realtime json database ideal for this use case?
What are the limitations on number of users, number of messages and latency?
How does it compare to "Google Cloud Messaging", native push notifications, or other frameworks, for the same purpose?
Firebase is a real time json data base and it would work absolutely fine for what you are requesting.
There is no limitation to the number of users you can have but there is a limitation to the number of active connected users you can have. The free pricing tier allows 100 active connections at one time. The more expensive tiers allow for unlimited active connected users. There is no limitation on number of messages. Latency is very low. Changes are displayed almost instantly.
I haven't personally worked with Google cloud messaging or any other real time frameworks so I can't answer that. But firebase has great documentation and is very easy to set up and implement. The only downside is that firebase do not currently provide push notifications. However they can easily be implemented with a push notification service such as Batch