Pipelining verstuurt meerdere Redis-commando's in één enkele netwerkround-trip in plaats van te wachten op het antwoord van elk commando voordat het volgende wordt verzonden. Dit verbetert de doorvoer drastisch bij het uitvoeren van veel commando's, omdat netwerklatentie — niet Redis zelf — vaak de bottleneck is.
Het probleem: round-trip latentie
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: batch de commando's
pipeline = redis.();
( id userIds) pipeline.();
results = pipeline.();
