Thank you for the answers! They are really helpful!

Best regards,
Anton Podviaznikov

On 1 October 2011 13:56, Jeremiah Peschka <[email protected]>wrote:

> You can search the archives with a very gmail style interface over at
> http://markmail.org. Use the search filter list:com.basho.lists.riak-users
>
> Object versioning can be done in as many ways as you'd like ;) It's going
> to be a matter of working within your data model and defining how you'd like
> it to work. Since you probably don't want to use object sibling (trust me,
> you don't),  you can play tricks with keys and use a meaningful key plus the
> timestamp, or a version number, much like is done with software.
>
> Another option would be to keep a separate version bucket and store
> versioned objects in there. This would involve two saves on your part (one
> for the original object being pushed into the version bucket and one for the
> new version) but I can't see an easier way.
>
> Finally, there's no easy way that I know of to retrieve all links in a
> hierarchy. Just like you can't tell a relational database "I have this row,
> give me every row that's related to this row in some way" (the hell of
> recursive CTEs not considered), Riak has no such functionality. You can,
> however, write a looping query to perform this search for you.
>
> Instead you could use the new secondary indexes feature  and index your
> versions with a single value for easy identification. All versions of a
> document have an index on a canonical name for the document - this could be
> an ISBN, URL, internal identifier. Then querying for older versions becomes
> a matter of performing a secondary index query and finding the right objects
> rather than walking a link hierarchy that could end up being cyclical if you
> aren't careful.
>
> ---
> Jeremiah Peschka - Founder, Brent Ozar PLF, LLC
> Microsoft SQL Server MVP
>
> On Oct 1, 2011, at 7:44 AM, Anton Podviaznikov wrote:
>
> > Hi,
> >
> > I just starting to use Riak and have following situation:
> >
> > I want to store some JSON documents inside Riak. After updating document
> I want to save new copy in the same bucket with the link to the "parent"
> revision.
> >
> > Then my task is to retrieve all revisions for the specified document.
> > However I didn't find any examples how to do this if I don't know the
> depth of the tree (amount of revisions), there are just examples hot to
> achieve first linked document or second. Do you have any hints?
> >
> > One more question: are there any patterns for storing versioned objects
> inside Riak? Any previous discussion on this list?
> >
> > P.S. Since probably these question was asked previously can you suggest a
> way how to make search over this mailing list? I see archive (
> http://lists.basho.com/pipermail/riak-users_lists.basho.com/) but  don't
> know how to search it.
> >
> > Thank you in advance!
> >
> > Best regards,
> > Anton Podviaznikov
> > _______________________________________________
> > riak-users mailing list
> > [email protected]
> > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
Best regards,

Anton Podviaznikov
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to