A common patterns for doing this would be to store the document in something like docs/docid and the meta in a derived location such as docs_meta/docid. You could map reduce the meta in the docs_meta bucket to get a list of keys that would exist in the docs bucket. Derived locations are a good way to go especially in 1 to 1 relationships. Link walking is another method. Your meta document could store links to other documents in its link headers that would also be retrieved either by a link walking m/r or further down the line after some query style m/r where you filter the metadata itself. Links are unidirectional in Riak.
Hope this helps. -Alexander On Aug 9, 2010, at 3:13 AM, Steve Lloyd wrote: > As a complete new starter on riak, I wonder if someone could advise on what > is the idiomatic way of using riak in the case of wanting to store a document > together with some associated metadata (and wanting to retrieve the object > based on metadata queries). Application-imposed link from the 'metadata' > document to the key of the 'main' document? A parent child relationship? > Thanks. > > > ---- > International Baccalaureate > Steve Lloyd Research Engineer-Business Analysis > Peterson House, Malthouse Ave. Cardiff Gate, CARDIFF CF23 8GL, United Kingdom > Tel: +44 2920 547869 | Fax: +44 2920 547779 | Web: http://www.ibo.org > > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com _______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
