riak /

Full commit
#+OPTIONS: author:nil timestamp:nil

Welcome to Riak.

* Overview
  Riak is a distributed, decentralized data storage system. 
  Below, you will find the "quick start" directions for setting up and
  using Riak.  For more information, browse the following files:
  * README:  this file
  * TODO:    a list of improvements planned for Riak
  * LICENSE: the license under which Riak is released
  * apps/    the source tree for Riak and all its dependencies
  * doc/
    - basic-setup.txt:  slightly more detail on setting up Riak
    - basic-client.txt: slightly more detail on using Riak
    - architecture.txt: details about the underlying design of Riak
    - index.html:       the root of the edoc output of 'make docs'

* Quick Start

  This section assumes that you have copy of the Riak source tree. To get started, you need to:
  1. Build Riak
  2. Start the Riak server
  3. Connect a client and store/fetch data

** Building Riak

   Assuming you have a working Erlang (R13B03 or later) installation,
   building Riak should be as simple as:

   $ cd $RIAK
   $ make all rel

** Starting Riak

   Once you have successfully built Riak, you can start the server with the following commands:

   $ cd $RIAK/rel/riak
   $ bin/riak start

   Now, verify that the server started up cleanly and is working:

   $ bin/riak-admin test

** Connecting a client to Riak


Assuming no errors were generated during the server start step, a
simple client interaction will look like:
(remember, $RIAK should be set to the local path to your Riak installation)

$ erl -name riaktest@ -pa $RIAK/ebin -setcookie riak_demo_cookie

(riaktest@> %% connect to Riak
(riaktest@> {ok, C} = riak:client_connect('riakdemo@').

riaktest@> %% Create a shopping list for bread at /groceries/mine
riaktest@> O0 = riak_object:new(<<"groceries">>, <<"mine">>, ["bread"]).

(riaktest@> %% store the list
(riaktest@> C:put(O0, 1).

(riaktest@> %% retrieve the list
(riaktest@> {ok, O1} = C:get(<<"groceries">>, <<"mine">>, 1).

(riaktest@> %% extract the value
(riaktest@> V = riak_object:get_value(O1).

(riaktest@> %% add milk to the list
(riaktest@> O2 = riak_object:update_value(O1, ["milk"|V]).

(riaktest@> %% store the new list
(riaktest@> C:put(O2, 1).

(riaktest@> %% find out what else is in the groceries bucket
(riaktest@> C:list_keys(<<"groceries">>).