Pipelining একটি একক নেটওয়ার্ক round-trip-এ একাধিক Redis কমান্ড পাঠায় প্রতিটি কমান্ডের উত্তরের জন্য অপেক্ষা করার পরিবর্তে। এটি অনেক কমান্ড জারি করার সময় থ্রুপুট নাটকীয়ভাবে উন্নত করে, কারণ নেটওয়ার্ক লেটেন্সি — Redis নিজেই নয় — প্রায়শই বটলনেক।
সমস্যা: 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.();
