by marshray · 13y ago · 0 comments
bucket: 'users'
'jbellis/email', 'jbellis@example.com'
'jbellis/phone', '555-5555'
What would I lose by doing this?In effect, you throw out a lot of the less talked about advantages of NoSQL and end up with something more like traditional SQL databases (not necessarily a bad thing, just different).
create bucket.users ( id uuid, username text, email text, phone text, primary key (uuid, username) );
That would be exactly how the data was encoded.
What marshray suggested would look like this:
create table bucket.users (name text, field text, value text, primary key ((name, field))); - with a composite partition key. Then you'd have two separate single-cell partitions "jbellis:email" : "jbellis@example.com" and "jbellis:phone" : "555-5555". You don't want to do that in either Riak or Cassandra.