Firebase Best Practices: keeping Google BigQuery Costs Down
We specifically designed AdLibertas to use the Google batch export feature — which is currently free.
But your own data costs, if not properly managed, can become significant and will scale with time. So here are some tips to keep your BigQuery costs low.
Disable Data Streaming Inserts – in December of 2020 Firebase started realtime streaming into BigQuery by default to enable up-to-date data. However this will increase price significantly and may be unnecessary for most AdLibertas customers. To disable streaming events:
- Login to your Firebase Console.
- Go to project settings > integrations > Google Analytics Manage
- Open the Linked Google Analytics account which should take you to the Google Analytics admin dashboard.
- Click BigQuery Linking under the Product Linking section for the linked Google Analytics property
- Select the Firebase project ID from the list.
- Disable the Streaming checkbox and then click Save (button in the upper right).
Setting Table Expiration – Once the BigQuery integration is enabled for Firebase projects with a paid plan, Google creates a new dataset that will incur an ongoing storage cost. AdLibertas will import and save new data as it is made available.
We recommend setting a default table expiration time of at least 60 days to keep the storage costs down. This is so Google has enough time to finalize and send all event data to BigQuery before expiring the table. To enable a default table expiration time:
Note, you’ll need to repeat these instructions for each Firebase project on a paid plan.
- Visit your BigQuery console
- In the Resources pane, select your dataset.
- In the Details page, click the pencil icon next to Dataset info to edit the expiration.
- In the Dataset info dialog, in the Default table expiration section, enter a value for Number of days after table creation.
- Click Save.
Reducing Unnecessary Events – Reducing the number of user events has an important factor on data-set size, overhead — and cost. Therefore we recommend periodically auditing your user events and disabling/delete the unnecessary or non-valuable user events.
For example: Google automatically logs an event “screen_view” automatically for each screen a user sees. For apps with a high-amount of screen-views, this could be an unnecessary burden. See this article for manually tracking screen views.