appendfor a single atomic batch.appendSessionfor ordered, pipelined batches on a persistent connection.Producerfor submitting individual records with per-record tickets.
Appends also support match sequence numbers and fencing tokens. See concurrency control for the write coordination model.
Single-batch append
A single batch of records can be appended by callingappend on a stream client:
- TypeScript
- Python
- Go
- Rust
Append session
An append session maintains a bidirectional stream with S2: you send batches of records, and S2 sends back acknowledgements.Under the hood, sessions use S2S, a minimal binary framing layer over HTTP/2. In environments without HTTP/2 (notably browsers), the TypeScript SDK falls back to HTTP/1.1. You get the same session APIs, but append batches cannot be pipelined, so there will only be one in-flight batch at a time.
submit().
Submitting a batch is an async function. It resolves to a BatchSubmitTicket when the batch is accepted by the session; this async function can exhibit backpressure, to prevent overwhelming the session.
A ticket tracks an append while it is pending. The batch is only durable once it has been acknowledged by S2. This can be awaited via the ticket’s ack() method, which resolves only when the written batch is fully durable on object storage. The resulting AppendAck contains information about the batch’s resulting position in the stream.
- TypeScript
- Python
- Go
- Rust
requestTimeout, the SDK will mark it failed and either retry, if so configured, or surface an error.
Backpressure
The session tracks how much data is “in flight” (submitted but not yet acknowledged). When you hit the limits,submit() blocks until capacity frees up.
This is intentional: it prevents unbounded memory growth and naturally throttles your application to match what S2 can handle.
Producer
The Producer API provides a record-oriented interface over append sessions. You submit individual records and get back a ticket for each one. The producer groups submitted records into batches according to configurable thresholds. This is particularly useful when:- You’re receiving records one at a time (from a message queue, HTTP requests, etc.)
- You want confirmation that specific records are durable
- You want append-session ordering, pipelining, and backpressure without managing batch boundaries yourself
- TypeScript
- Python
- Go
- Rust
Batching Configuration
The producer flushes whenever any threshold is hit. For latency-sensitive applications, a shorter linger time means records are written sooner. For throughput-sensitive applications, a longer linger time means more efficient batching.

