RiakREST¶ ↑
More information available at RiakREST.
Description:¶ ↑
RiakREST is a Ruby library providing structured, RESTful interaction with Riak, an open-source document datastore.
Riak:¶ ↑
Riak is an open-source project developed and maintained by the fine folks at Basho Technologies. Riak combines a decentralized key-value store, a flexible map/reduce engine, and a friendly HTTP/JSON query interface to provide a database ideally suited for Web applications.
RiakREST¶ ↑
RiakREST provides Ruby interaction with Jiak, the HTTP/JSON interface to a Riak cluster, through two different levels of Jiak interaction: Core Client and Resource. Core Client works at the Jiak level and mirrors Jiak internals, whereas, Resource is an abstraction built on top of the Core Client that gives a simplier, RESTful feel.
Requirements:¶ ↑
RestClient (Ruby gem rest-client) is used for RESTful server interaction.
JSON is used for data exchange.
Riak provides the runs the server cluser and provides the Jiak HTTP/JSON interface. store.
Install:¶ ↑
sudo gem install riakrest
Example¶ ↑
require 'riakrest' include RiakRest class People include JiakResource server 'http://localhost:8002/jiak' attr_accessor :name, :age end # Created and store a resource. remy = Person.new(:name => 'Remy',:age => 10) remy.post # Change and store remy.age = 11 remy.put # Create another resource callie = Person.new(:name => 'Callie', :age => 13) callie.post # Add a link from remy to callie tagged as 'sister' remy.link(callie,'sister') remy.put # Retrieve sister via link sisters = remy.query([Person,'sister']) puts sisters[0].eql?(callie) # => true remy.delete callie.delete
License:¶ ↑
Copyright © 2009 Paul Rogers, DingoSky. See LICENSE for details.