Tom Haughey thaughey at
Wed Oct 10 01:30:36 EDT 2012

I just attended the Webinar on Intro To Riak. It did not say much about
schema design, just the one page. That is what I focus on. So let me ask a

Say we have a bucket called Customer with Customer No : “123”. This
customer has attributes (key : value pairs) of: name : “Joey Brown”, date
of birth : “1/1/1980”, postal code : “12345”, customer type : “retail” date
became customer : “1/1/2005” purchase frequency : “5”

The JSON could be:

{ "name": “Gunther Boss”, "date of birth" : “1/1/1980”, "postal code" :
“12345”, "customer type" : “retail” "date became customer" : “1/1/2005”,
"purchase frequency" : “5”}

How does Riak know that these attributes all belong to Customer 123? That
Customer No is the ID? How do we specify the id for the whole row?

Cassandra uses the following:

RowId + Column Family + Column Qualifier + Timestamp + Value (or Payload).
(RowId + Column Family + Column Qualifier + Timestamp provide uniqueness).
The key is Column family + Column Qualifier

I believe I would assign Customer ID as the key to the bucket (Customer),
and the rest of the data would be stored in a string or blob. The
application would be responsible to decompose the string into the
appropriate fields. In my example above, there is one row containing key =
123, and the above document as the value { "name": “Gunther Boss”, "date of
birth" : “1/1/1980”, "postal code" : “12345”, "customer type" : “retail”
"date became customer" : “1/1/2005”, "purchase frequency" : “5”}. How do I
actually specify the key? In the JSON example, is there a reserved word or
expression to indicate what the key is? Or how do you actually specify the
key in RIAK?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list