WriteBatch
class WriteBatch
A group of writes that commit together.
A batch is one log record, one checksum and — under Durability.SYNC — one fsync, so batching is both the atomicity mechanism and the throughput mechanism. Recovery replays a record only if its checksum holds, which is what makes a batch all-or-nothing across a crash.
Atomicity here is a statement about durability: after recovery a batch is either wholly present or wholly absent. It is not yet a statement about visibility — a concurrent reader may observe part of a batch that is mid-apply, which is what snapshots exist to fix and where they will.
Not thread-safe; build a batch on one thread and hand it to DocumentStore.write.