I have a use-case where I need to query based on a 2i value and retrieve all the Riak objects intstead of only keys. Doing a map-reduce operation for this took quite a long time and more computations.
Is there any other solution for this?
I have a use-case where I need to query based on a 2i value and retrieve all the Riak objects intstead of only keys. Doing a map-reduce operation for this took quite a long time and more computations.
Is there any other solution for this?
Since a 2i search returns a list of matching keys, you can then make multiple parallel requests to fetch the associated objects.
Riak is not like a traditional RDBMS where you try to minimize the number of fetch requests you make. I recommend benchmarking to find an ideal number of parallel requests to maximize performance to fetch objects.
Finally, please ensure that you are using a load balancer between your application and Riak so that these fetch requests are balanced among the nodes in your cluster.