Skip to content

Commit 56366df

Browse files
Document bulk batch size and concurrency configuration
The flowvault README noted that bulk calls are split into batches sent concurrently, but never documented how to configure that. Add a "Batching and concurrency" section covering the per-operation env vars, their defaults and maximums, and how effective values are resolved. Values verified against Constants.java and the configure*ConcurrencyAndBatchSize methods in VaultController: batch size is min(value, max) with a warning-and- clamp above the max and a warning-and-default for invalid input; concurrency is additionally capped at ceil(itemCount / batchSize), so it never exceeds the number of batches to run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent da8f043 commit 56366df

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

flowvault/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The `flowvault` module is a Skyflow Java SDK built for high-throughput vault ope
2828
- [Timeouts and retries](#timeouts-and-retries)
2929
- [Logging](#logging)
3030
- [VaultController — Bulk operations](#vaultcontroller--bulk-operations)
31+
- [Batching and concurrency](#batching-and-concurrency)
3132
- [Bulk Insert](#bulk-insert)
3233
- [Bulk Tokenize](#bulk-tokenize)
3334
- [Bulk Detokenize](#bulk-detokenize)
@@ -307,6 +308,36 @@ Every bulk response has the same two-part shape:
307308

308309
That per-record shape is the point of these APIs; see [Error Handling](#error-handling) for the full model.
309310

311+
## Batching and concurrency
312+
313+
Batch size and concurrency are configured **per operation** through environment variables — there is no builder or options API for them. Each value is read from the process environment first, then from a `.env` file in the working directory.
314+
315+
| Operation | Batch size variable | Default | Max | Concurrency variable | Default | Max |
316+
|-----------|--------------------|---------|-----|---------------------|---------|-----|
317+
| Bulk insert | `INSERT_BATCH_SIZE` | 50 | 1000 | `INSERT_CONCURRENCY_LIMIT` | 1 | 10 |
318+
| Bulk tokenize | `TOKENIZE_BATCH_SIZE` | 50 | 1000 | `TOKENIZE_CONCURRENCY_LIMIT` | 1 | 10 |
319+
| Bulk detokenize | `DETOKENIZE_BATCH_SIZE` | 50 | 1000 | `DETOKENIZE_CONCURRENCY_LIMIT` | 1 | 10 |
320+
| Bulk delete tokens | `DELETE_TOKENS_BATCH_SIZE` | 50 | 1000 | `DELETE_TOKENS_CONCURRENCY_LIMIT` | 1 | 10 |
321+
322+
Concurrency defaults to **1**, so batches are sent one after another unless you raise the limit.
323+
324+
How each value is resolved:
325+
326+
- **Batch size**`min(yourValue, max)`. Above the max, the SDK logs a warning and uses the max. Zero, negative, or non-numeric values log a warning and fall back to the default.
327+
- **Concurrency**`min(yourValue, max, batchCount)`, where `batchCount = ceil(itemCount / batchSize)`. Concurrency never exceeds the number of batches there are to run. Same warning-and-fallback behaviour for invalid values.
328+
329+
Those warnings are emitted at `WARN`, which the default `ERROR` level hides — set `LogLevel.WARN` or below to see them (see [Logging](#logging)).
330+
331+
For example, 500 records with `INSERT_BATCH_SIZE=100` and `INSERT_CONCURRENCY_LIMIT=10` produces 5 batches, all 5 in flight at once — the concurrency is capped to 5, not 10.
332+
333+
```dotenv
334+
# .env
335+
INSERT_BATCH_SIZE=100
336+
INSERT_CONCURRENCY_LIMIT=5
337+
```
338+
339+
The 10,000-item ceiling per bulk call is a separate, fixed limit and is not configurable.
340+
310341
# Bulk Insert
311342

312343
Insert many records — even across different tables — in a single call. Each record is a `BulkInsertRequestRecord` with its own `data` and, optionally, its own `tableName` and `upsert`.

0 commit comments

Comments
 (0)