Could I have server side code on firebase database that references other databases or storages that I created? Like for example, have url of image in firebase storage be verified to exist when writing the url to database?
Related
In my app, I have an SQLite/Room database. I want to introduce synchronisation between the devices of my users.
I want to combine my local SQLite/Room DB with a cloud Firebase DB.
I want my SQLite database to be stored in the Firebase Database when the users are logged in, otherwise let it store offline. Any changes to the local database should be reflected in Firebase Database when logged in. Also if a user deletes the local database he/she can retrieve it from Firebase Database. I just want to use Firebase for the synchronization between the local database and Firebase Database.
How can I do it? My app is in Android with Java as a backend.
In my app I have SQLite/Room database. I want to introduce sync between the devices of my users. I want to combine my local SQLite/Room DB with cloud Firebase DB.
I don't see any reason why you would add an additional local database to your application, since both Firestore and the Realtime Database have their own offline persistence mechanism. However, you can implement such a feature but you should take into consideration that the entire mechanism of synchronization should be managed by you.
I want my SQLite database to be stored on the Firebase Database when the users are logged in otherwise let it store offline.
This can be simply done without a local database. How can you achieve that? Simply by attaching an auth state listener to track the user auth state. This means that when you're using Firestore, you can specify the source for reading the data. For example, if the user is authenticated you can read the data from Source.SERVER, otherwise from Source.CACHE.
Also if the user deletes the local database he/she can retrieve it from Firebase Database.
There's currently no API that does that. You should implement your own mechanism. You should track the user when it deletes the database and then take some actions accordingly.
I just deleted my flutter app from firebase console , but it is still working and changing data in the realtime database.
Can anyone tell me how its still connected with the firebase?
Thanks
According to Firebase documentation, when you delete an app:
Corresponding API keys or OAuth clients are NOT deleted. You can clean
up the API keys or OAuth clients in the Google APIs console
credentials page. Deleting these resources will break installed
applications: your users will no longer be able to authenticate or
sign in.
Access to the realtime database is not limited to apps that are registered in the Firebase console. Any code that has the proper configuration for your database, can try to access that database. If you want to be more selective in who can access the database, you will need to do this with Firebase's server-side security rules, typically in combination with Firebase Authentication.
I am making an app which uses firestore now. I have enabled persistence. I just wanted to know if Firestore keeps a local copy of the entire cloud database or Just the stuff which is accessed by the app through queries.
The local cache that the Firestore client only contains:
the data that your app has recently listened to, and
a queue of the write operations that the local client has performed, but that haven't been synchronized with the server yet
I learnt about real-time data storage and hosting storage from this post Difference between Data Storage and Hosting Storage?
But i am still not clear about real time Database and and newly introduced file storage.
Does anybody have some brief explanation about it ?
Thanks in advance .
(As per the concern about duplicated with Difference between Data Storage and Hosting Storage? what the problem solves and what i am asking are two different things and hosting storage and file storage are different in case of google firebase )
Firebase now offers these places to store your data:
Realtime Database
Remote Config
Hosting
Storage
Cloud Firestore
The best place to store your data, depends on the type of data you want to store and the way you want to consume it.
The Firebase documentation says this about it:
The Firebase Realtime Database stores JSON application data, like game state or chat messages, and synchronizes changes instantly across all connected devices.
Firebase Remote Config stores developer-specified key-value pairs to change the behavior and appearance of your app without requiring users to download an update.
Firebase Hosting hosts the HTML, CSS, and JavaScript for your website as well as other developer-provided assets like graphics, fonts, and icons.
Firebase Storage stores files such as images, videos, and audio as well as other user-generated content.
On choosing between Cloud Firestore and the Firebase Realtime Database, the Firebase documentation says:
Firebase offers two cloud-based, client-accessible database solutions that support realtime data syncing:
Realtime Database is Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.
Cloud Firestore is Firebase's new flagship database for mobile app development. It improves on the successes of the Realtime Database with a new, more intuitive data model. Cloud Firestore also features richer, faster queries and scales better than the Realtime Database.
*Realtime database store data only json format and it is specially used in app where data is synchronized concurrently like ola app(user location),sensex(Nifty) app where data not persist .
*Firebase Storage just only store data like memory card.It is specially used for store backend data of app.
Can we implement Firebase for an android app, where I am registering user using Mobile number (Similar to Whatsapp). Users will be sent a code by server which is entered by user in android app to validate the user mobile number and registering him on the server.
Question : Can I use the above method in conjunction with Firebase Auth?
I was earlier going to use MongoDB for my project, but since Firebase has SYNC capabilities, it will be a better choice for storing data. Another good reason is as below:
If a client loses its network connection, your app will continue
functioning correctly.
Every client connected to a Firebase database maintains its own
internal version of any active data. When data is written, it's
written to this local version first. The Firebase client then
synchronizes that data with the remote database servers and with other
clients on a "best-effort" basis.
Very NEW to Firebase, just came to know about firebase (through Google 2016 IO).
https://firebase.google.com/docs/database/android/save-data
Firebase hosting is not for server side processing.
It stores static assets of your website as a world-class high availability CDN. So websites hosted here loads very fast. Even in high-availability scenarios.
So you have to do processing at other server which then connects with firebase and stores userinfo in realtime database.
Firebase has put limits on userinfo to be placed in directly for users auth dashboard.
For detailed userinfo, firebase realtime db is the way to go(from your processing backend to firebase realtime db).
Further Reading: What kind of web applications are Firebase not ideal for?