WALEvent SourcingMessage QueueKafkaBatch WritesAsyncWrite Scaling

Write Offloading

Handle high write throughput with WAL, event sourcing, async writes via message queues, and buffered batch writes. Decouple write ingestion from persistence.

26 min read10 sections
01

The Big Picture — Why Writes Bottleneck

A database write is expensive. It must validate constraints, update indexes, write to the WAL, flush to disk, and replicate to followers — all before acknowledging the client. A single instance tops out at ~10,000-20,000 . When your system needs 500,000 writes per second, direct synchronous writes to the database simply don't work.

🍽️

The Restaurant Order Queue

A busy restaurant doesn't have the chef cook each dish the instant it's ordered. That would overwhelm the kitchen during rush hour. Instead: the waiter writes the order on a ticket (WAL), puts it on the order rail (queue), and tells the customer 'your order is confirmed.' The kitchen processes tickets at its own pace, batching similar orders together (batch writes). If the kitchen falls behind, orders queue up but nobody is turned away. The customer doesn't wait for the food to be cooked before getting confirmation — they wait for the ticket to be written. That's write offloading.

🔥 Key Insight

Write offloading decouples write ingestion (accepting the data) from write persistence (storing it durably). The client gets a fast acknowledgment. The actual database write happens asynchronously, in batches, or through a pipeline. This turns a synchronous bottleneck into an asynchronous, scalable flow.

1 / 10