(Read) Policy Replica `CLOSEST` and/or `LOCAL`


#1

Currently, aerospike has 2 policy values for (read) replica: master and any, the latter of which means “a random choice of which replica to read”. I would like to suggest other policy values, closest, which means “read from the replica which has lowest latency”, and/or local, "read from unix socket/loopback interface if applicable, otherwise from closest or any".

My use case: we are planning to use aerospike for session storage. We have 4 web instances running behind a load balancer in share-nothing manner. On each of these 4 instances, we will install an aerospike agent with replication-factor=4, ie 1 node will be master, and the rest in the cluster will have replicated data. To speed up read, it is preferred that the web app in each instance read from local aerospike, instead of randomly from the any of the instance of the cluster.


#2

I agree fully, this is a straightforward imporvement in any given client, and it is in our backlog — but it has been for a few months. If you have any ability to add this feature to our client before we get to the request ourselves, please submit a pull request, we’d really appreicate it.