Realtime Database usage

120 views
Skip to first unread message

Ken Ara

unread,
Mar 29, 2024, 10:34:09 AM3/29/24
to Firebase Google Group
According to the Firebase console /database/usage/current-billing/connections page, my app is downloading 1-2 GB per day of RTDB data. That's too much and I'm trying to track down where that data is coming from or going.

In the developer tools (Firebase and Chrome), there's practically no traffic from firebaseio.com under the "WS" section (or under "All") in the Network tab. Clearly, data is flowing when pages are requested - plenty is logged to the console. I've disabled caching and opened pages in Private windows.

I could see the data being sent and received, that would help. Even so, I am the only person with access to this app and I can't see how my usage could add up to a GB or more per day.

Any advice?

Ken Ara

unread,
Apr 8, 2024, 5:09:40 PM4/8/24
to Firebase Google Group
I'm here to answer my own question in case anyone with a similar question finds this through a search.

I tried a few strategies but saw no reduction in the data being downloaded. Only authenticated users that I create can access the functionality of my app so it wasn't bots or search engines. I looked at my Cloud Functions and deleted any that were no longer necessary, though I could see from the dashboard that they were not being executed. I implemented a new caching strategy based on IndexedDB that was able to account for frequent changes to a user's following. That was cool. But mostly I combed through 10,000 lines of code looking for any unnecessary calls to Firebase. I found a few candidates but that didn't solve the problem.

When I searched for information on logging I quickly learned that Firebase doesn't provide that. Then I asked my preferred AI. It suggested a step-by-step approach that I had mostly already followed but as a "next step" it suggested the Firebase Realtime Database Profiler, which hadn't come up in my searches for logging. Within minutes I found the source of the excessive downloads.

Happy coding!
Reply all
Reply to author
Forward
0 new messages