In the Redis protocol documentation it states:
A client can use the same connection in order to issue multiple commands. Pipelining is supported so multiple commands can be sent with a single write operation by the client, it is not needed to read the server reply in order to issue the next command. All the replies can be read at the end.
However, I can't find any example of how this is actually implemented. How does a Redis client implement pipelining?
Just throwing in some more insights to the above answers. One way to understand redis pipeline is to understand the fact that redis pipeline is completely a client side implementation and the redis server has nothing to do with it. While this differs among different client implementation, here's the generalized idea:
Pipelining is aimed at solving response latency issues in high network latency environments. So, the lesser the amount of time spent over the network in sending commands and reading response, the better. This is effectively achieved by buffering. The client may (or may not) buffer the commands at the TCP stack (as mentioned in other answers) before they are sent to the server. Once they are sent to the server, the server executes them and buffers them on the server side. Unlike the usual case where the client reads the response as soon as the response is received, in case of pipelining, the client reads the responses form the server-side buffer in parts or when the application executes 'sync' (close the pipeline). This is advantageous because the time spent over the network by the client in reading the responses is far lesser.
Here's a post on my blog which you may refer to get a better idea: http://nachivpn.blogspot.in/2014/11/redis-pipeline-explained.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With