0

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 question.

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

Thanks

TomFH
  • 55
  • 3

1 Answers1

2

Riak is a key-value store, and does not have a concept of columns. It just stores binary data (can naturally be a string or a JSON document as well as something else) identified by a single key.

In this example you would possibly store the customer data as a JSON document under the key '123' which is the customer number.

Christian Dahlqvist
  • 1,665
  • 12
  • 9