My app is growing in terms of bandwidth usage with Firebase database and I am trying to optimize my queries to use less bandwidth (thus reduce cost) but I am doing this quite blindly because there are no statistics about my database usage (I can't know what queries take the most bandwidth).
Is there somehow a way to know which queries are taking a lot of bandwidth? How do you go about optimizing usage with Firebase database?
Edit:
I have a chat website, and I use observers such as messagesRef.child(conversationID).limitToLast(25).on('child_added'...
conversationsRef.child(conversationID).('participants').on('value'...
The Firebase Profiler saved my life for this. https://firebase.google.com/docs/database/usage/profile
Was able to pinpoint exactly what reference (including children) was hogging the bandwidth, which made it much easier to figure out which part of the code is problematic.
there's no query tuning tools, if that's what you're looking for. you could build in simple time logging to capture just before and after queries are issued, log that data, and harvest it from client to narrow down to the most poorly performing ones.
hard to help without seeing the actual queries or the data model.
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