Java Client - Maps - fetch only one entry
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.
On Thu, Feb 25, 2016 at 10:36 PM, Cosmin Marginean <cos.marginean at gmail.com>
> 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
> 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.
> 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>
>> 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.
>> riak-users mailing list
>> riak-users at lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users