Improve a workload with many small writes
If an application sends many tiny insert requests, first measure request overhead and decide which rows can be supplied together. Coordinator DB supports multi-row VALUES, INSERT SELECT and formatted bulk input. It does not expose a part-count threshold or a background merge queue to tune.
CREATE TABLE batched_items(id INTEGER PRIMARY KEY, value TEXT);
INSERT INTO batched_items(id, value)
VALUES (1, 'a'), (2, 'b'), (3, 'c');Choose batch boundaries according to the application's error and retry requirements. A repeated batch can encounter existing keys; decide whether conflicts should fail, be ignored or update values. Do not confuse batching with a promise that arbitrary repeated requests are safe.
For related statements that must commit together, use an explicit transaction. Native connections retain the transaction; HTTP requires its full lifetime inside one request. For files, use the documented native-client input or attached HTTP upload workflow and select a format that represents the values correctly.
Observe terminal duration, write counters and errors for representative batches. Retain request size and response limits when increasing batch size rather than assuming the largest possible request is best.
See inserting rows, bulk input, transactions and HTTP limits.