Search code examples
google-cloud-datastoregoogle-cloud-firestore

Are Firestore updates charged the same cost as writes?


According to Firestore documentation, it is possible to update a single field without updating the entire document:

def update_create_if_missing():
db = firestore.Client()
city_ref = db.collection(u'cities').document(u'BJ')

city_ref.update({
    u'capital': True
}, firestore.CreateIfMissingOption(True))

Are Firestore updates charged as writes?

Is there an option such as "update if different" instead of the current one which is updating if missing?

I have built quite a heavy price comparison application with more than 1 million products (each product is a document in Firestore) updated on a daily basis. It would be quite expensive if I had to pay 1.000.000 writes per day on top of the Firestore reads.

Is there any alternative I could explore?


Solution

  • Firestore document updates are not different than writes. Any operation that changes a document is considered a write.