- Create a
Google Cloud VM - Install
MongoDBon the VM to store Tiki product data - Create a
GCS bucket - Create the
BigQuerydatabase and tables
Script: migrate_data
- Export the
productcollection from thetikidatabase to a JSON fileproduct.json - Upload the JSON file to the
mongodb-data-1bucket - Use
parallel_composite_upload_thresholdto enable parallel composite uploads if the file size exceeds 150 megabytes - After the upload process is done, remove the JSON file
- Use
crontabto run the script at 22:00 everyday
Script: load_data
- Create a Google Cloud Function that triggers when the file
product.jsonis uploaded to themongodb-data-1bucket and loads the data into theproducttable within thetikidatabase in BigQuery - Write records that failed to load to the BigQuery table to
failed_records.jsonfor later handling - Output: tiki_product_sample
Script: creat_datamart
- Create the
seller_productdatabase - Create table
sellerandproductfrom tabletiki.product - Output: seller_sample/product_sample
Script: analyze_data