About how via keys get value in riak

Sean Cribbs sean at basho.com
Wed Jun 27 08:01:07 EDT 2012

Hi Jason,

Riak's model is that of a simple key-value store, you typically can only
look things up by key. You will have to structure your data and keys
differently so they can satisfy the access pattern you're looking for. For
example, maybe you have a key which is just {node, itemid} (although maybe
it'd be <<"node-itemid">> because keys in Riak are binaries), and that key
has a list of the comments, or even just their keys. My point is that, even
if you use Riak's secondary indexes feature, you'll have to do more work
up-front to structure your data to fit the queries you want to answer.

On Tue, Jun 26, 2012 at 11:55 PM, 郎咸武 <langxianzhe at gmail.com> wrote:

> Hi guys,
>        This is mnesia operation in the following:
>                mnesia:dirty_match_object({comments,{Node, ItemId, '_'},
> '_'}).
>        Now, I want to get it from riak.
>        For example:The KEY is {node, itemid, comment1}  and {node,itemid,
> comment2}.
>        I want to get comment1 and comments via {node, itemid, '_'}. I am
> confused in riak.  How to do ?
>        Can anyone give some idea?
>        Thanks
> Jason
> --
> 只为成功找方法,不为失败找理由
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Sean Cribbs <sean at basho.com>
Software Engineer
Basho Technologies, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120627/edbb74d1/attachment.html>

More information about the riak-users mailing list