Pipelining sendet mehrere Redis-Befehle in einer einzigen Netzwerk-Roundtrip, anstatt auf die Antwort jedes Befehls zu warten, bevor der nächste gesendet wird. Es verbessert den Durchsatz drastisch bei vielen Befehlen, da Netzwerk-Latenz – nicht Redis selbst – oft der Engpass ist.
Das Problem: Roundtrip-Latenz
Normally each command is a request→reply round-trip:
send GET → wait for reply → send GET → wait for reply → ... (N × network latency)
→ Redis processes each command in microseconds, but each round-trip adds network
latency (e.g. 0.5ms). For 1000 commands, that's ~500ms JUST in waiting!
Pipelining: Befehle gruppieren
pipeline = redis.();
( id userIds) pipeline.();
results = pipeline.();
