Search code examples
javaaerospike

How to implements redis pipeline similar behavior in aerospike


Can any one please suggest, how to implement/use redis pipeline like behavior in aerospike java client.


Solution

  • Redis is a single-threaded database with a simple request/response protocol. Since every command must be processed one by one, and each request has to have a response back, this can add up to a lot of latency if you have many operations. Pipelining is a way to send multiple commands at once, have the server process all of them, then get all the results back in a batch.

    Aerospike is multi-threaded with its own custom wire protocol that can run multiple commands in parallel over the same connection. The official drivers handle sending commands as efficiently as possible.

    Aerospike does have something called Multiple Operations which means you can send multiple commands that act on the same key as one combined command. The java (and other language) drivers also support async operations which should further increase concurrent performance in your code.