googleapis / googleapis/google-cloud-python

Support AsyncBulkWriter

Open
#15,370 1 comment 0 reactions 1 assignee Assigned to @daniel-sanche View on GitHub
api: firestore priority: p3 type: feature request
Dominant language
Python
Stars
5.4k
Forks
1.8k
Avg merge
3d 4h
Merged PRs (30d)
122

Description

While the current implementation of BulkWriter offers performance gains over batch writes, it has the following comment:

```
The submission of batches is internally parallelized with a ThreadPoolExecutor,
meaning end developers do not need to manage an event loop or worry about asyncio
to see parallelization speed ups (which can easily 10x throughput). Because
of this, there is no companion `AsyncBulkWriter` class, as is usually seen
with other utility classes.
```

In fact, the flush method uses time.sleep, which is explicitly blocking. It would be great to have an actual async bulk writer as the current version is not useful in truly async codebases.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.