Pipelining στέλνει πολλές εντολές Redis σε ένα ενιαίο network round-trip αντί να περιμένει την απάντηση κάθε εντολής πριν στείλει την επόμενη. Βελτιώνει δραματικά την απόδοση όταν εκδίδονται πολλές εντολές, επειδή η network latency — όχι το Redis — είναι συχνά το bottleneck.
Το πρόβλημα: round-trip latency
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 οι εντολές
pipeline = redis.();
( id userIds) pipeline.();
results = pipeline.();
