Skip to content

Gate Firestore backup update on a successful BigQuery write#56

Merged
ernysans merged 9 commits into
mainfrom
copilot/upgrade-backup-to-storage-write-api
Jun 13, 2026
Merged

Gate Firestore backup update on a successful BigQuery write#56
ernysans merged 9 commits into
mainfrom
copilot/upgrade-backup-to-storage-write-api

Conversation

Copilot AI commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a new production-grade BigQuery streaming writer using the BigQuery Storage Write API, updates the Firestore-to-BigQuery backup logic to use this new writer, and updates documentation and exports to reflect these changes. The most important changes are as follows:

BigQuery Streaming and Backup Logic

  • Added a new BigQueryStreamWriter class in lib/bigquery-stream-writer.js that wraps the BigQuery Storage Write API (@google-cloud/bigquery-storage) for high-throughput, at-least-once streaming writes, with batching, backpressure, connection reuse, and type coercion.
  • Refactored lib/backup.js to use BigQueryStreamWriter for streaming Firestore documents into BigQuery, replacing the legacy tabledata.insertAll method. The backup function now buffers and flushes rows via the Storage Write API and handles errors and resource cleanup more robustly. [1] [2]

Exports and API Surface

  • Exported BigQueryStreamWriter from lib/index.js, making it available as a public API. [1] [2]

Documentation and Instructions

  • Updated README.MD and .github/copilot-instructions.md to document the new @google-cloud/bigquery-storage dependency, and to instruct on mocking it in tests. [1] [2] [3] [4]

Dependency and Versioning

  • Bumped the package version to 1.0.1 in package.json to reflect these new features and changes.

Copilot AI changed the title [WIP] Upgrade backup to use BigQuery Storage Write API Migrate BigQuery write path to Storage Write API (managedwriter) Jun 13, 2026
Copilot AI requested a review from ernysans June 13, 2026 14:30
Copilot AI changed the title Migrate BigQuery write path to Storage Write API (managedwriter) Resolve BigQuery destination project from table metadata instead of an explicit project-id lookup Jun 13, 2026
Copilot AI changed the title Resolve BigQuery destination project from table metadata instead of an explicit project-id lookup Add BigQueryStreamWriter for Storage Write API ingestion Jun 13, 2026
Copilot AI changed the title Add BigQueryStreamWriter for Storage Write API ingestion Integrate BigQueryStreamWriter into backup.ts Jun 13, 2026
Copilot AI changed the title Integrate BigQueryStreamWriter into backup.ts Gate Firestore backup update on a successful BigQuery write Jun 13, 2026
@ernysans
ernysans marked this pull request as ready for review June 13, 2026 21:07
@ernysans
ernysans merged commit 5422460 into main Jun 13, 2026
2 checks passed
@ernysans
ernysans deleted the copilot/upgrade-backup-to-storage-write-api branch June 13, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants