Hi,

We are pretty new to data modelling in cassandra, and are having a bit of a
challenge creating a model that caters both for queries and updates.

Let me try to explain it using the users example from
http://www.datastax.com/dev/blog/basic-rules-of-cassandra-data-modeling

They define two tables used for reading users, one by username and one by
email.
---------------------------------------------------------------------
CREATE TABLE users_by_username (
    username text PRIMARY KEY,
    email text,
    age int
)

CREATE TABLE users_by_email (
    email text PRIMARY KEY,
    username text,
    age int
)
---------------------------------------------------------------------

Now lets pretend that we need to delete a user, and we are given a username
as a key. Would the correct procedure be:
1) Read the email from users_by_username using the username as a key
2) Delete from users_by_username using the username as a key
3) Delete from users_by_email using the email as a key

Or is there a smarter way of doing this?

Yours sincerely,
  Bo Madsen

Reply via email to