The link limitation is governed, I believe, by the max size of the metadata
that can be attached to anything you're storing in Riak. IIRC, it comes out
to some large value, like ~100,000 links for a single key. You can overcome
this limitation, too, but storing all of the links to any given key, you
could create a lookup bucket (e.g. if Users can have many Comments, you
could have a users_comments bucket that contains the user key and then an
array of comment IDs).

There is no link indexing in Riak, so if you need to examine every
relationship, you're better off building up multiple look up buckets to
speed up the look ups so that you can avoid having to perform a key listing
operation.

There's more about links and link walking in the wiki quick start guide:
https://wiki.basho.com/display/RIAK/Links+and+Link+Walking

There was a webinar that Bryan Fink gave a while back about using Rails 3
and Riak to build a wiki. While it's not specifically about data modeling,
it does have a lot of good information on data modeling with Riak:
http://vimeo.com/14275191

There are a few articles on the basho blog about designing your data schema
as well: http://blog.basho.com/category/schema/

Also, if you want to search the mailing list archives, you can check them
out here: http://blog.gmane.org/gmane.comp.db.riak.user/

As far as data to store in Riak: I would store whatever you want, within
reason of course. Data will be written to the server and you'll receive a
response code so you know your data has been correctly written to W servers.
Likewise, when you read data back, you'll receive an error if enough servers
do not respond with data in a reasonable time frame.

HTH,

Jeremiah Peschka
Microsoft SQL Server MVP
MCITP: Database Developer, DBA
614.515.0727


On Sun, Sep 19, 2010 at 11:56 PM, Mark Jarecki <[email protected]>wrote:

> Hi,
>
> I was wondering if there is a practical limit to the number of links
> between objects - for example, if a User object has a 'friend' link to many
> other User objects. Are these links indexed somehow within Riak to speed up
> any queries on these relationships?
>
> Also, are there any good links to best practice data modelling in Riak? I'm
> completely new to document databases, however, can see that Riak (in
> combination with Lucene) might really suit a project I'm starting, but I'm a
> little uncertain how best to model various objects, especially as I still
> think in SQL/tables. Is there anything that might outline some newbie
> pitfalls - apart from the Basho docs.
>
> I'd also like to know, what data wouldn't you store in Riak atm? I guess,
> I'm wondering what guarantees you get that data is written successfully
> (i.e. transactions), and how mature is the project in regards to production
> installations that trust it with critical data. Has anyone stored critical
> data such as billing data in Riak successfully, or would MySQL/Postgres
> still be a safer bet here? Although I do like the idea of managing fewer
> systems.
>
> Soooo many questions....
>
> Cheers,
>
> Mark
> _______________________________________________
> 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

Reply via email to