As per documentation we can measure the performance of our Firebase Realtime Database with the database profiler tool. Since my app is in live and I want to check bandwidth data by traversing all over the application only on my device. Can I do this using database profiler tool or any other way to do it?
The Firebase Realtime Database profiler runs on the entire database instance. There is no configuration option or API to run the profiler for a single device.
If you want to profile the behavior of a single device, consider setting up a secondary database (in the same project or in its own project) and running the profiler on that instead.
Related
More a design question / explore options - I have a Firebase Realtime Database backed project where I have IOT-like devices (ESP32) that periodically measure environmental conditions and stores data in the database, and a flutter app that users use to associate devices with their account, view data and update device settings.
My question is about the best setup for the IOT devices - i currently have them all using a single service account to access the database and insert new readings. I'm concerned this may open up the project to security issues, and that there is no way to restrict security priveledges of a single device.
The other option is to create individual user accounts for every device (each device would have to register themselves with their own unique id). This would then allow every device to be disabled individually and operate through the security rules defined for the database, but lead to a larger number of users in the auth db and more complex iot device code.
Am I missing anything from the above? Has anyone done something similar and can offer some design insight?
i currently have them all using a single service account to access the database and insert new readings.
You should only use a service account in trusted environments, as they have full unrestricted access to your Firebase project. In all other scenarios, consider regular SDKs such as the non-privileged Node.js SDK that is great for using on IoT devices.
I was able to configure the Firestore database in Firebase with my flutter app and also create and read documents from my collection but when I go to Firestore console I don't see the created data, also when I creat data manually I am unable to see it in my application.
I am using the test mode which means any user can read or write.
I hope someone can help me with this puzzle.
Thanks!!!
It sounds like the device/emulator that you are running on is not connected to the internet, or at least not to the Firestore servers. In that case, the client writes all local changes into a local database, waiting to send them to the server when it gets a connection. So the local app will work, but won't be able to synchronize its local cache with the database servers.
You might want to check the connection on your device, and any proxies that might exist between your app and the Firestore servers.
I am a newbie to mobile development and I am building a mobile game in react native for android devices where I want to store user centric information such as score for different levels in realtime database in firebase. My users would be in playing game in restricted internet connectivity(where user connects to internet once in few days) and I want a mechanism such that app should store data locally even when the application "RESTARTS" or the app is killed by user and when internet connectivity comes, should be able to push all data on server.
I have two questions:
Can I some how automatically send data to server without user opening the app when the internet connectivity is established?
I found support for enabling offline data persistence in case of application or operating system restart for android in Java and kotlin
(https://firebase.google.com/docs/database/android/offline-capabilities), but did not find support for react native. I have gone through documentation of React Native Firebase library (https://rnfirebase.io/docs/v5.x.x/database/reference/database), but did find option to enable data persistence option for case when application/os restarts. Is there any workaround for this?
What you are looking for is Cloud Firestore, it has data persistence built-in so you won't have to worry. Use react-native-firebase for that, it has an absolutely beautiful documentation and guides and the community is very helpful too.
To sync your local data with the server without user opening app, you'll need to delve into the native side and make an Android Service that runs in the background and checks for internet connectivity regularly. As soon as the internet is connected, it can start the Cloud Firestore sync.
Do not use Realtime Database for this. Use Cloud Firestore which is way better.
Our iOS app uses CoreData as the local datastore and we use Firebase to sync the local data across devices. We also rely on FireBase for user authentication, so its just not the data sync. All our queries are done against the local database. This 'local db + Firebase' combination has worked well so far and we are starting to build the Android version.
With the new brand new Android code, we are debating if we should follow the same approach as iOS or just use ONLY the Firebase database.
Some features that are important to our app:
Work completely offline (Firebase does a great job of syncing when there is online access)
Have a single cloud database as the source of truth i.e. mimicking a server side database
Reduce network usage, i.e. use it only when required
Be able to perform a variety of queries on the data
Real time data across devices (Firebase realtime sync is awesome )
Any disadvantages to our existing approach 'local db + Firebase' or what will we lose if we switch to using just the Firebase Database ?
FireBase just released FireStore which was built from the ground up to also support offline mode. Looking forward to test this
Is there any tool to monitor the data transfer to my real time database in firebase? To see how many user connect at live time and how much data is transferred?
There's a usage tab in your Firebase Database console that has most of that information.
We also just released a tool that allows you to profile your database usage. See that tool's blog post and reference documentation.