The interview problem

Practice prompt

A transactional service is limited by storage flushes. Explain group commit and design acknowledgment rules that improve throughput without silently weakening durability.

Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.

1. Scope and assumptions

Assume a write-ahead log and a storage stack that correctly implements the required flush semantics. Local durability and replicated durability are separate promises.

2. Worked approach

transaction records
  → ordered WAL
  → flush boundary
  → durable position
  → covered acknowledgments

Append each transaction's log records and commit marker to an ordered buffer. A flush coordinator chooses a boundary, durably flushes through it and wakes only transactions whose commit positions are covered. Concurrent appenders beyond that boundary wait for a later flush.

Track written and durable positions separately. Recovery replays committed records according to the database's protocol, not every byte found in a buffer. If the product offers an asynchronous commit mode, name the potential acknowledged-write loss explicitly and isolate it from operations requiring durable acknowledgment. A replication acknowledgment needs its own confirmed persistence/apply condition.

3. Calculate the example

At one serialized 2 ms flush per transaction, the flush-limited upper bound is 500 transactions/s, ignoring all other work. If 20 commits share each such flush, the corresponding bound is 10,000/s. Waiting to gather a batch adds latency; a two-millisecond gather window plus two-millisecond flush can make an early transaction wait roughly four milliseconds before acknowledgment. These figures are an illustrative bottleneck model, not a database benchmark.

4. Failure cases and trade-offs

Waking transactions based on the append position instead of durable position acknowledges volatile data. Flush errors must fail or stop the affected commit path. A device that lies about persistence violates the assumed storage contract; software batching cannot repair that guarantee.

Larger batches amortize flush cost but increase waiting and failure blast radius for unacknowledged work. Time- and size-bounded batching balances tail latency with throughput. Asynchronous acknowledgment may be valid for explicitly loss-tolerant data, not as an invisible optimization.

5. Validate the result

Inject crashes before append, before flush, after flush and before reply. Verify every acknowledged durable transaction recovers, and retry ambiguity is handled at the application boundary. Measure batch size distribution and acknowledgment latency under low as well as high load.

6. Interview follow-ups and self-review

Can an unacknowledged transaction still commit? What does a replicated durable acknowledgment require?

Reward durable-frontier reasoning, correct throughput bounds, crash cases and explicit durability contracts.

Sources and related practice

Technical reference: www.postgresql.org — Asynchronous-commit durability distinction; group-commit protocol and numbers are original.

Exact publication/update date not established in this review. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.

Continue with Design a double-entry payment ledger; Design point-in-time database recovery.

Continue your preparation

Choose a connected learning path or browse more System design questions. Read our editorial method and attribution policy.