Optimized way for querying using aerospike client for javay

I have a set (set1)

Bins :

bin1 (PK = key1)

bin2 (PK = key1)

bin3 (PK = key2)

bin4 (PK = key2)

Which is more optimized way(in terms of query time, cpu usage, failure cases for 1 client call vs 2 client calls) for querying the data from aerospike client from the below 2 approaches:

Approach 1 : Make 1 get call using aeropsike client which has bins = [bin1, bin2, bin3, bin4] and keys = [key1, key2]

Approach 2 : Make 2 aerospike client get calls. First call will have bins = [bin1, bin2] and keys = [key1] and Second call will have bins = [bin3, bin4] and keys = [key2]

I find Approach 2 more cleaner, since in Approach 1 we will try to get the record for all combinations (e.g. : bin1 with key2 as primary key) and it will be extra computation and the primary key set can be large. But the disadvantage of Approach 2 is two Aerospike client calls.

This is cross posted on Stack Overflow, and I’ve answered your question over there.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.