Difference between Firebase real-time database and Cloud Firestore [duplicate] - android

This question already has answers here:
What's the difference between Cloud Firestore and the Firebase Realtime Database?
(5 answers)
Closed 5 years ago.
On the firebase console a Cloud Firestore tab has been added and going through the documentation it has some similar features like Realtime database. My android app already uses the Real-time database, functions, and storage and everything work fine. I would like to know how the Cloud Firestore can make my application better and what are the special features present only in Firestore that are not there in the real-time database that could improve my application.
I have a chat based application running on the real-time database and I am performing very frequent requests for small amount of data. Will switching to Firestore reduce my cost? Will it maintain or increases the speed of operation?

A developer advocate answers in blog post
The main points:
Better querying and more structured data
Designed to Scale
Easier manual fetching of data
Multi-Region support for better reliability
Different pricing model

The Cloud Firestore is an upgrade on the Real-time database although the Cloud Firestore is still in beta.
The Cloud Firestore offers
Better and faster data queries. With the C. Firestore, data at the top collections can be fetched without grabbing any sub-collections in its children node. This prevents downloading unwanted data from your db unlike the real-time db.
Scalability: The above already explain why this is more scalable.No matter how large your db is, your app will only request for necessary data unlike the real-time db.
Read more: https://firebase.google.com/docs/firestore/rtdb-vs-firestore

Related

Sync firebase database with sqlite database in Android

I'm using sqlite to store data in my app, i would like to sync my database with firebase so that i can do modify data from firebase and insert it into my database without updating the app. Any suggestions how can i do that.
You don't need to sync Firebase with your local database. Firebase provides you SDK to perform read/write operations in your database. You might only need to update your application if there is a schema change. That too can be achieved without keeping the computation logic in the Cloud and instead call Cloud Functions for cases where you know there are going to be a lot of schema changes.
Firebase provides you really well documented APIs and code samples. You can refer the following links for more information:
Firebase Docs -- SDKs here
Cloud Functions -- For cloud computation
Realtime Database -- Database for realtime transfer, can be costly for high usage. Generally used for PoC or low traffic projects
Firestore -- Upgraded version of Realtime DB. Generally used for high traffic.

Applying data mining techniques on Firebase

Can i perform data mining techniques on a Firebase's Database?
I want to classify data that i will get from the user and come with some results from it for my Android graduation project.
The project core is Data mining, so is Firebase friendly for this?
The Firebase Realtime Database API is optimized for synchronizing data between large numbers of users. It is not ideally suited for data mining, which typically requires different access patterns to the data.
Note that it's quite possible and common to combine the Firebase Realtime Database with other data storage solutions to server all needs of an app. Many developers combine Firebase with BigQuery, using the latter for their data analysis. That way your users/app can write straight to the Firebase Database (or Cloud Firestore). You'll e.g. use Cloud Functions to pass that data onto BigQuery, where you do the analysis on it. Any analysis result you'll write back to the Firebase Database, where clients can read them. With this approach Firebase functions as a proxy between your (mobile) clients and your custom cloud infrastructure.

Using Firebase Firestore in offline only mode [closed]

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 4 years ago.
Improve this question
I'd like to use just a single method of persistence in my app, and am using Cloud Firestore for my premium/paying users.
Is it possible to also use Firestore in offline only mode for free users so that I don't incur costs?
Cloud Firestore is an online database that continues to work when you're offline for short or longer periods of time. But it's still primarily an online database, and should not be used as a fully offline database.
One reason for this is that Firestore keeps the local mutations in a separate queue until they've been committed to the server. When a query/read hits the local data, the Firestore client combines the cached reads that it got from the server, with the local mutations. As the queue of local mutations grows, this operation gets slower. As long as the client occasionally synchronizes the data to the server, this slow down won't be significant. But if you use Firestore as a fully offline database, it will become prohibitive over time.
For a good explanation of how the Firestore client works under the hood, have a look at these (long) code comments in the Firestore JavaScript SDK:
the persistence class, which is responsible for storing the data on the local disk
the local store class, which handles (a.o.) the reading from both the local cache and the local mutations.
If you need offline database, do not use Firebase. Firebase will cost you huge money in the future. Read this full article from an unhappy Firebase customer with 3+ years Firebase usage experience.
Sadly, We've been using Firebase for our Goal Meter app (Android and iOS), Weight Meter app (Android). Our users have grown over years and now we have about 100,000 active users for our Goal Meter app. About %95 of them are free users. The cost of Firebase database is growing rapidly and we cannot prevent free user data from syncing into Firebase online database. We've decided to change to another company for our future project.
Don't make the same mistake that we did. If your app needs offline database (I guess most apps do need it), then by any means avoid using Firebase. Move to other solutions such as AWS.
I've already contacted the Google Firebase team regarding this ridiculous issue. I can only imagine one scenario why Google Firebase team is preventing the full offline capabilities. The reason is because Firebase team is greedy. After all, if the database is offline, how can they make you pay? We've been in love with every single product from Google. We even produce Android version before iOS one, in order to support Android and Google. Firebase product is amazing, but this "purposefully" disabling offline capabilities is a shame. A shame for Firebase team and Google in general.
An alternative approach is allow users to create accounts and offer a trial period. If they decide to sign up for premium access, all the data is already synced to Firestore. This doesn't solve your want to have local only access, but could be a different option you could take.

Firebase Storage Sync api

I am trying to develop an app whereby I want to exchange files (video, images) within the cloud storage(firebase) and client(android app).
I wanted to know if there is any sync API in firebase which keeps track of any updates i.e any changes being performed in the firebase storage and replicating the same to the client (and vice-versa if possible).
Thanks in advance !!
Go to the page of Firebase and read what the header says:
Store and sync data in real time
Furthermore:
The Firebase Realtime Database is a cloud-hosted NoSQL database that
lets you store and sync data between your users in real-time.
What Realtime means is this:
Instead of typical HTTP requests, the Firebase Realtime Database uses
data synchronization—every time data changes, any connected device
receives that update within milliseconds. Provide collaborative and
immersive experiences without thinking about networking code.
So just add Realtime Database Dependency and you are set. This itself will serve the purpose of Sync API you need.

Is it recommended to use firebase database only for auto-update functionality

I have an android application, which stores data in the MySQL database. This MySQL database is being updated using a SQL database in the cloud server. Only data in the cloud database is updated to the MySQL database and it is not updating vice versa. I'm planning to implement firebase database instead of MySQL only because of its auto-update and offline functionalities. Real-time database is not actually needed in my case, as the cloud data is not changing frequently(changes only in 1-2 days). Please help me to choose between firebase and MySQL database.
If the data is not real-time you may as well stick with your current solution. Firebase works really well for simple lists of constantly updating, live data. SQL works much better for highly relational data that may need complex querying.
It all comes down to the type of data in your app.

Categories

Resources