Java Client - Maps - fetch only one entry

Vitaly E 13vitamins at gmail.com
Thu Feb 25 15:56:57 EST 2016


I would advise against search for many reasons. IMO writing two copies of a
value - one in a map (when the entire map is required) and the other in a
separate key (for most cases) will work much better.

You can also store the values of a map in separate keys for
retrieval/updates, and also have a set of the keys for those [rare] cases
when you need all values that belong to the map. The latter requires
several round-trips, but I believe will be still faster, easier to
maintain, and more reliable than search.

Regards,
Vitaly


On Thu, Feb 25, 2016 at 10:36 PM, Cosmin Marginean <cos.marginean at gmail.com>
wrote:

> Yes, we ended up doing that in the end. Was just a usecase where
> _sometimes_ the map was required as a whole, while _other times_ only a
> specific entry. I believe search would help with some of this, but we are
> still looking into that.
>
> Thanks everyone for your help
>
> Cheers
> Cos
>
> On 25 Feb 2016, at 19:56, Vitaly E <13vitamins at gmail.com> wrote:
>
> Hi Cosmin,
>
> Sorry for the dumb question, but if you are interested in a specific entry
> why not to store it as a separate key? It would be easier for updates, too.
>
> Regards,
> Vitaly
>
> On Thu, Feb 25, 2016 at 9:40 PM, Cosmin Marginean <cos.marginean at gmail.com
> > wrote:
>
>> On 25 Feb 2016, at 19:26, Cosmin Marginean <cosmarginean at gmail.com>
>> wrote:
>>
>> Hi,
>>
>> I couldn’t find this anywhere in the docs: is there a mechanism in Riak
>> to fetch only one Register (or a specific entry) from a map?
>> We have a use case where we have a map and need to only get the value for
>> a key in the map, rather than the whole map, and I would rather not
>> transfer the entire thing on the client.
>>
>> Cheers
>> Cos
>>
>>
>> _______________________________________________
>> riak-users mailing list
>> riak-users at lists.basho.com
>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20160225/ae2abfeb/attachment-0002.html>


More information about the riak-users mailing list