Loading…
Unlocking powerful analytics with Stripe Data Pipeline and Google BigQuery
Sushant Jain
- Source
- Stripe
- Published
- Added to Yomu
Summary
As businesses scale, the post addresses the need to move Stripe revenue data into BigQuery for recurring reporting and analysis. It describes configuring Stripe Data Pipeline to export transactions, invoices, subscriptions, and payments to Google Cloud Storage, then using a Python-based Google Cloud Run Job to discover the latest snapshot through data_load_times.json and enumerate each table’s Parquet files. The loader sends those files to BigQuery with the Google Cloud clients, creates missing tables, uses WRITE_TRUNCATE to retain the latest snapshot, and parallelizes table loads with ThreadPoolExecutor while collecting errors. After deployment and a test execution, the workflow is verified in BigQuery and scheduled to run every six hours, providing an automated path to refreshed Stripe data for analytics.
Context
Businesses need a reliable way to centralize Stripe revenue data for accounting, product, growth, reporting, and analysis as they scale. The post also identifies manual data handling, pipeline maintenance, outages, and delays as problems that automated delivery can reduce.
Approach / What changed
Configure Stripe Data Pipeline in the Stripe Dashboard to export modeled data to Google Cloud Storage, then deploy a Python script as a Google Cloud Run Job. The script reads data_load_times.json to find the latest table paths, lists Parquet files for LIVEMODE tables, loads them into BigQuery in parallel with the Google Cloud Storage and BigQuery clients, and records loading errors. The job is tested, verified in BigQuery, and scheduled to run every six hours.
Takeaways
- data_load_times.json provides the latest folder path for each Stripe Data Pipeline table; the script filters entries by the configured LIVEMODE mode before listing Parquet files.
- The BigQuery load configuration uses WRITE_TRUNCATE, so each run replaces the destination table and leaves the latest snapshot available rather than accumulating snapshots.
- ThreadPoolExecutor runs table loads in parallel, while the deployment uses a Google Cloud Run Job with up to five retries and can be scheduled every six hours.