I'm trying to model a simple address book schema that I will use for HBase/Cassandra.
The scenario:
- A user can create his contacts.
- A contact may have many phones, addresses or emails.
- A user can create groups to organize his contacts (a group can contain many contacts and a contact can be placed in many groups).
The only select query that I'm planning to do is to grab all the contacts who live at address x and are in group y.
Would the following schema be appropriate for this?
|Table name: User |
-----------------------
Key: user_id
email
password
-----------------------
Column family: Contacts
Key: contact_id
firstname
lastname
---------------
Column family: Address
Key: address_id
street
housenumber
zipcode
---------------
Column family: Group
groupname
Or is this better/possible?
|Table name: User |
-----------------------
Key: user_id
email
password
-----------------------
Column family: Contacts
Key: contact_id
firstname
lastname
contact_id
|Table name: Address |
-----------------------
Key: address_id
street
housenumber
zipcode
contact_id
|Table name: Group |
-----------------------
Key: group_id
group_name