Search code examples
firebasegoogle-cloud-firestorebilling

Firestore billing for writes that have no effect


Im trying to find out how firebase is billing write operations. In the billings documentation I could not find a clear definition of when a write is counted. Lets say I run a set query with the exact same data of the original documen, such that the document won't be affected, will this be billed as a write operation?

When I run my query with the console open nothing happens, and i was just wondering if these writes do also count.


Solution

  • When you write data, the server doesn't check if the data you write is the same as what already exist. Instead: it writes the data you provide. Hence: writing the same data is still counted as a write operation.

    I find it easiest to understand the billing for Firestore by thinking of it as reads from/writes to a disk. When you tell a disk to write a file, it writes that file.