Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firestore trigger cost implications

Being on the Blaze plan, what are the cost implications when it comes to firestore triggers?

Do I assume correctly that a trigger by itself doesn't generate any extra reads from database?

I still have a feeling that triggers are not free from perspective of CPM/memory consumption. And from that perspective do I understand correctly that firestore triggers can be treated just like any other firebase functions?

like image 224
vir us Avatar asked Oct 07 '20 09:10

vir us


People also ask

Is firestore cost effective?

Although Firestore is very affordable with little usage, costs start to increase as you begin to scale. In most cases, the cost of using Firestore at scale is more expensive than other providers.

How can I reduce firestore costs?

A simple solution for reducing the costs in Firestore through database refactoring. As we already know, Cloud Firestore is a scalable, cloud-hosted, NoSQL, real-time database from Firebase and Google Cloud, and it's is optimized to store large collections of small documents.

How expensive can Firebase get?

Expect to pay about $ 12.14 per month for an app with 50,000 installs and 5,000 daily active users. And about $ 292.02 per month for 1 million app installs and 100,000 daily active users, and approximately $ 2951.52 per month for 10 million app installs and 1 million daily active users.

Is firestore faster than Realtime Database?

Cloud Firestore also features richer, faster queries and scales further than the Realtime Database. Realtime Database is Firebase's original database. It's an efficient, low-latency solution for mobile apps that require synced states across clients in realtime.

What are the limitations of Cloud Firestore triggers for Cloud Functions?

Note the following limitations for Cloud Firestore triggers for Cloud Functions: Ordering is not guaranteed. Rapid changes can trigger function invocations in an unexpected order. Events are delivered at least once, but a single event may result in multiple function invocations.

What does the spending limit apply to in FireStore?

Note: For Firestore, the spending limit applies only to your storage costs and database operations. Network bandwidth costs are not included. To see how Firestore billing costs accrue in a real-world sample app, see the Firestore billing example. Read the Firestore documentation.

What is FireStore function in Firebase SDK?

Cloud Firestore function triggers The Cloud Functions for Firebase SDK exports a functions.firestore object that allows you to create handlers tied to specific Cloud Firestore events. Note: Cloud Firestore events will trigger only on document changes.

What is the relationship between attributes and cost in FireStore?

The understood relationship between these attributes is that you have to sacrifice a desirable trait to do well with the other two, and getting all three is impossible. It’s not a whole lot different when modeling data in Firestore, except the primary attributes are: Cost: What you are paying to get your requirements met.


2 Answers

The Firestore document that triggers your Cloud Function is included in the context. There is no document read or bandwidth charge for accessing this document.

You will be charged for the invocation and CPU/memory usage of the Cloud Function itself, as well as for any additional Firestore access you perform inside your Function's code.

like image 80
Frank van Puffelen Avatar answered Oct 25 '22 08:10

Frank van Puffelen


According to the Firebase docs:

Firestore Triggers
With Cloud Functions, you can handle events in Cloud Firestore with no need to update client code.

So Firestore triggers can only be done via Cloud Functions. For cloud functions there are costs for running a function (https://firebase.google.com/pricing) and the costs of listening to changes (snapshots) or reading/writing to Firestore will be added to that. Depending on what you are planning to do you also have to account for the internet traffic generated between the Firestore and the Cloud Functions, but this depends on some variables.

So, yes you are correct.

like image 20
TruffelNL Avatar answered Oct 25 '22 10:10

TruffelNL