Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Analytics - Set data location for BigQuery

We have a Firebase Project setup, with Analytics and export to BigQuery configured.

The integration has been successful and our events are being migrated to BigQuery just fine.

However, we face an issue with the data location set in BigQuery.

Our Firebase project has Default GCP resource location set as eur3 (europe-west). During setting up the integration between Firebase Analytics and BigQuery, we had no option to set any data location.

We can see the location for the dataset is US in BigQuery. I believe BigQuery is now supported in EU data centres, how can we use the EU location rather than US?

like image 445
Aaron Avatar asked Aug 24 '20 15:08

Aaron


People also ask

How do I change the dataset location in BigQuery?

After you create the dataset, the location cannot be changed, but you can copy the dataset to a different location, or manually move (recreate) the dataset in a different location. BigQuery processes queries in the same location as the dataset that contains the tables you're querying.

How do I change the default GCP resource location in Firebase?

After you set your project's default GCP resource location, you cannot change it. If you set up Cloud Firestore or Cloud Storage, you're prompted to select your project's default GCP resource location in the Firebase console workflow.

Where is BigQuery data stored?

BigQuery stores table data in columnar format, meaning it stores each column separately. Column-oriented databases are particularly efficient at scanning individual columns over an entire dataset.


1 Answers

Now there is an option to change location as written bellow

  1. Go to the Firebase console and disable the Google Analytics BQ Export (uncheck all boxes, and turn off the toggle)
  2. Navigate to https://console.cloud.google.com/bigquery
  3. Create a new dataset to house a copy of the Analytics data (eg: analytics_123456789_copy).
  4. Open the original analytics_123456789 dataset, and click the "Copy" button.
  5. Select the new dataset (analytics_123456789_copy) as the destination; Click "Copy".
  6. Wait for the copy to complete. Status can be viewed in the BigQuery Transfer page.
  7. Delete the original table, analytics_123456789 This cannot be undone, so make sure the data is either backed up, or the copy has completed.
  8. Create a new dataset with the same name, analytics_123456789, making sure to select the desired target region (eg: EU).
  9. Open the analytics_123456789_copy dataset and copy the data to the new analytics_123456789.
  10. Go to the Firebase console and reenable the Google Analytics BQ Export (enable the toggle, check the relevant checkboxes).
  11. Optional: Wait for the copy to complete, then delete the copied dataset, analytics_123456789_copy.
like image 130
Klemen Vrhovec Avatar answered Oct 23 '22 02:10

Klemen Vrhovec