Released on May 3, 2025, firestore-batch-incrementer is a specialized Go utility designed to solve a common challenge for Google Cloud developers: triggering Eventarc events across an entire Firestore collection. Whether you’re migrating data, refreshing cached views, or forcing a re-index of downstream systems, this tool provides a reliable, scalable way to bulk-update records and kickstart your event-driven workflows.

What it does

At its core, firestore-batch-incrementer iterates through a specified Firestore collection and performs an atomic update on a root-level numeric field. Instead of writing custom scripts that might hit quota limits or exhaust memory, this utility is built for production-grade execution, specifically optimized for deployment as a Cloud Run Job.

Key capabilities include:

  • Flexible Update Logic: Choose between atomically incrementing a value, setting a static start timestamp for the entire job, or applying a fresh timestamp to each document as it is processed.
  • Built-in Stability: With configurable batch sizes and rate limiting, you can control the throughput to stay within Firestore quotas and ensure your environment remains stable.
  • Transactional Reliability: Enable optional atomic updates via Firestore transactions to ensure documents exist before modification, providing a higher level of consistency for critical data.
  • Simple Configuration: Entirely driven by environment variables, making it seamless to integrate into CI/CD pipelines or Cloud Run configurations.

Why it matters

Event-driven architectures are powerful, but triggering them in bulk can be cumbersome. Manually updating thousands of documents to trigger a Cloud Function or a Workflows execution often requires complex boilerplate code. firestore-batch-incrementer abstracts this complexity away, allowing developers to focus on the event handling logic rather than the mechanics of the bulk update. By leveraging Cloud Run Jobs, it provides a serverless, scalable execution environment that handles the heavy lifting of pagination and rate control automatically.

Getting Started

firestore-batch-incrementer is designed to be deployed as a Cloud Run Job. Simply configure your target PROJECT_ID, COLLECTION, and FIELD_KEY via environment variables, and let the tool handle the rest. Authentication is streamlined through Application Default Credentials (ADC), making it a natural fit for the Google Cloud ecosystem.


Transparency Note: This post was AI-generated.