[Noob] Database Size vs Downloads

131 views
Skip to first unread message

Jacob Christ

unread,
Mar 12, 2017, 5:51:39 PM3/12/17
to Firebase Google Group
So I'm really excited about Firebase and the pricing seems fair-ish but I'm trying to understand the relationship between database size and downloads.  I've attached a screen from my Firebase Console that shows the last 24 hours.  I only have 18 bytes of data stored in the database and have only run my application / interacted with the DB maybe 10-20 times today.  Yet there are multiple instances where the 6K data limit was surpassed in the last four hours.  If there is no overhead then this means that the data has been downloaded at least 341 times each hour where usage is greater than 6K.  If I extrapolate this out to 10GB/month, it wouldn't take much more than 3MB of database "data" downloaded 10-20 times in total to reach the 10GB/month limit.

Is my thinking way off?

Jacob


DB Size vs Downloads.png

Jacob Christ

unread,
Mar 13, 2017, 9:51:48 AM3/13/17
to Firebase Google Group
Attached is an update.  I updated the one string that I am storing to 62B and my download number is nearly 1000x my DB size and yet I've only accessed the data a hand full of times.  I'm using the code right off the Firebase setup in Android Studio in my onCreate method..

I know Firebase keeps an open socket with google but this is ridiculous and a non-starter.

// Read from the database
myRef.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
// This method is called once with the initial value and again
// whenever data at this location is updated.
TextView textView = (TextView) findViewById(R.id.message);

String value = dataSnapshot.getValue(String.class);
textView.setText(value);
Log.d(TAG, "Value is: " + value);
}

@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
Log.w(TAG, "Failed to read value.", error.toException());
}
});
DB Size vs Downloads 2.png

Jacob Wenger

unread,
Mar 13, 2017, 2:19:39 PM3/13/17
to fireba...@googlegroups.com
Hey (other) Jacob,

The bandwidth number you are seeing is due to the fact there is an overhead associated with every time you navigate to the Firebase Console and it is noticeable when you have such a small amount of data actually stored in the Database. Every time you go to the Console, we bill for all bytes on the wire between your browser and the Realtime Database. This includes the protocol overhead, keep-alives (which go on every 30 seconds or so while the Console's open), etc.

In your particular case, the small (on the order of single-digit KB) protocol and HTTP overhead is actually much bigger than the data you are fetching (on the order of bytes). Extrapolating this multiplier to the point where you will be storing 100s of MB or GB is not an accurate estimation as the data overhead stays constant and does not grow linearly. The KB overhead you are seeing will be a rounding error when your data becomes of any reasonable size.

Also note that these data points are accumulations over a 15 minute window, not at any one point in time.

Cheers,
Jacob

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/1d86f71a-5e8b-44d8-8f75-72c5bb200259%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jacob Christ

unread,
Mar 13, 2017, 11:35:27 PM3/13/17
to Firebase Google Group
Hi Firebase Jacob,

This almost makes sense and I think its comforting.  I say almost, since my computer was on and a browser tab was open on the console for many hours where there was zero data registered.  Maybe updates only happen when the specific tab in the browser is active?  I shut all my console tabs and will see what it looks like tomorrow.

Thanks

(other) Jacob
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Jacob Christ

unread,
Mar 14, 2017, 6:22:09 PM3/14/17
to Firebase Google Group
Firebase Jacob,

One more question.  Does the console consume band width if your looking at the page that tells you how much bandwidth you have consumed or only on pages like the one that displays what is in the database.

(other) Jacob

On Monday, March 13, 2017 at 11:19:39 AM UTC-7, Jacob Wenger wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Jacob Wenger

unread,
Mar 14, 2017, 6:36:05 PM3/14/17
to fireba...@googlegroups.com
I honestly am not sure. I assume it would only use data if you are looking at the data viewer as the stats are pulled from a separate service.

Cheers,
Jacob

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Tyler Rockwood

unread,
Mar 14, 2017, 6:49:58 PM3/14/17
to Firebase Google Group
Chiming in here, I believe that currently the console connects if you're in the database view at all (I'm also not sure if it cleans up properly if you exit the tab, you could check in dev-tools). But I know the console team is working on fixing this, as it's not needed.

-Tyler
Reply all
Reply to author
Forward
0 new messages