Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Clarification or Solution for Atomic Operations Post batch() Deprecation

Open
#8,010 1 comment 0 reactions 1 assignee View on GitHub

@Hectorhammett is already working on this.

Since Nov 17, 2025.

Assessment

This issue has not been assessed yet.

Description

api: firestore

With the deprecation of the batch() method in the Firestore PHP SDK, I noticed that BulkWriter is being recommended as an alternative for performing multiple writes. However, it's unclear whether BulkWriter supports atomic write operations, where all writes either succeed or fail as a single unit.

Previously, the batch() method allowed for atomic operations using Google\Cloud\Firestore\WriteBatch. This feature was crucial for maintaining data consistency in scenarios where multiple writes needed to be applied together.

I came across this detailed comparison of Batched Writes vs. BulkWriter, which indicates that only Batched Writes support atomicity. While this aligns with the current understanding, I would like to confirm directly with the Google Cloud PHP development team whether BulkWriter provides a way to perform atomic writes or if there is another recommended alternative post-batch() deprecation.

Observation

I recently noticed an issue where duplicate increments occurred on a value in a Firestore collection. Unfortunately, I don’t have proper logs to confirm the root cause, but I suspect it might be related to BulkWriter retrying failed writes. This raised concerns about whether BulkWriter can guarantee atomicity or if retries might lead to inconsistent results in certain scenarios.

Dominant language
PHP
Stars
1.2k
Forks
464
Avg merge
2d 2h
Merged PRs (30d)
103

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-php

All issues in googleapis/google-cloud-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.