Home > Mobile >  Does the connection cost associated with writing to Firebase Realtime Database depend on the amount
Does the connection cost associated with writing to Firebase Realtime Database depend on the amount

Time:04-11

Note: There are similar SO questions related to costs associated with writing to Firebase Realtime Database (such as here), but I have a question that specifically relates to the relationship between write volume and the resulting connection cost.

So according to the Firebase documentation, it looks like the Realtime Database does not directly charge for writing data, although "writes can lead to connection costs on your bill".

But I would like to know, are these connection costs variable - dependent on the amount of data being written? Or is it the same no matter the size.

For example, if I update 10 MB of data once every minute, will this result in the same cost as writing only 10KB of data once every minute?

I'm trying to figure out what degree of "write-efficiency" is worth my time.

CodePudding user response:

The documentation you linked suggests an answer. Under "Protocol overhead" it states:

Each time a connection is established, this overhead, combined with any SSL encryption overhead, contributes to the connection costs. Although this isn't a lot of bandwidth for a single request, it can be a substantial part of your bill if your payloads are tiny or you make frequent, short connections.

This is pretty clearly saying that, due to necessary protocol overhead, frequent connections incur more expense than a single connection. It doesn't say that the connection costs are variable based on the size of the payload being written, so it stands to reason that the connection cost is fairly static. Think HTTP headers that are essentially the same for each connection.

  • Related