Pipelining dërgon shumë komanda Redis në një të vetme rrugë rrjeti në vend që të presë përgjigjen e secilës komande para se të dërgojë të njësuesen. Rrit ndjeshëm produktivitetin kur dërgon shumë komanda, sepse vonesa e rrjetit — jo vetë Redis — shpesh është penguesa.
Problemi: vonesa e rrugës rrethore
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: grumbullimi i komandat
pipeline = redis.();
( id userIds) pipeline.();
results = pipeline.();
