Links in Riak: what can they do/not do, compared to graph databases?

╄→гoц情女王★ 提交于 2019-11-30 14:29:14

Links in Riak are just some metadata (list of one-way references to foreign keys) stored along with value. They are usually used as an input to MapReduce that can do whatever you want with them, including simulation of RDBMS joins.

There are no integrity checks or any additional magic in them like finding reverse links. They are just a convenience API, absolutely the same could have been achieved by storing these lists of foreign keys inside the values, serialized in some way.

For social bookmarking example I'd recommend using Riak Search, because it allows more flexible queries like http://example.com/* and have proper distributed indexing and lookups.

Dmitri Zagidulin

blinkov's answer is correct. No, Riak Links are not appropriate for the scenario that you describe. There is no referential integrity checking, and there is a limit to how many links you can store with each object (I believe, up to 255).

Riak Search is much more appropriate for a social bookmarking scenario. In fact, the social bookmarking site Clipboard uses precisely this mechanism - bookmarks as Riak objects, with Riak Search enabled on them (for tagging, event triggers and notifications, etc). When the Ricon 2012 conference videos go up online, I recommend you watch the Clipboard talk for some more details on this.

Riak + Secondary Indexes would also be an appropriate solution to a lot of these cases. See my answer to Which clustered NoSQL DB for a Message Storing purpose? and How to structure data in Riak? for schema suggestions for a similar setup.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!