fivenines

Practice / target 80%

Pipelining And Output Buffers Practice

01

A client sends 1,000 `INCR` commands without reading replies. What improves, and what new server-side risk appears?

intro

Scenario

A batch job fires a thousand increments down one connection without waiting for any replies.

02

Why does pipelining preserve per-connection reply order without making the commands atomic?

intro

Scenario

A developer assumes that pipelining a read-modify-write sequence makes it safe from concurrent clients.

03

A single socket read contains three commands and the first half of a fourth. What should the parse-dispatch loop do?

applied

Scenario

One read from a pipelining client's socket lands three and a half commands in the input buffer.

04

A slow Pub/Sub client exceeds an output-buffer limit. Why is disconnecting it safer than keeping it indefinitely?

applied

Scenario

A subscriber that stopped reading has accumulated megabytes of undelivered pushed messages.

05

Which component should handle partial writes: command handlers, client output buffers, or the database?

advanced

Scenario

You are assigning responsibility for resuming a reply after the socket accepted only part of it.