Pipelining என்பது பல Redis commands-ஐ ஒரே network round-trip-இல் அனுப்புவது, ஒவ்வொரு command-ன் reply க்கு காத்திருந்து பிறகு அடுத்தையை அனுப்புவதற்குப் பதிலாக. অনேக commands-ஐ issue செய்யும்போது throughput-ஐ கணிசமாக மேம்படுத்துகிறது, ஏனெனில் 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: commands-ஐ batch செய்க
pipeline = redis.();
( id userIds) pipeline.();
results = pipeline.();
