cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roshni Rajagopal <Roshni.Rajago...@wal-mart.com>
Subject Data Modelling Suggestions
Date Thu, 23 Aug 2012 10:26:50 GMT
Hi,

Need some help on a data modelling question. We're using Hector & Datastax Enterprise
2.1.


I want to associate a list of items for a user. It should be sorted on the time added. And
items can be updated (quantity of the item can be changed), and items can be deleted.
I can model it like this so that its denormalized and I get all my information in one go from
one row, sorted by time added. I can use composite columns.

Row key: User Id
Column Name: TimeUUID:item ID: Item Name: Item Description: Item Price: Item Qty
Column Value : Null

Now, how do I handle manipulations

 1.  Add new item :Easy , just a new column
 2.  Add exiting item or modify qty: I want to get to the correct column to update . Can I
search by second column in the composite column (equals condition) & update the column
name itself to reflect new TimeUUID and qty?  Or would it be better to just add it as a new
column and always use the latest column for an item in the application code and delete duplicates
in the background.
 3.  Delete item: Can I search by second column in the composite column to find the correct
column to delete?

I was trying to find hector examples where we search for second column in a composite column,
but I couldn't find any good one. Im not sure if its possible.…if you have any do have any
example please share.

Regards,
Roshni


This email and any files transmitted with it are confidential and intended solely for the
individual or entity to whom they are addressed. If you have received this email in error
destroy it immediately. *** Walmart Confidential ***

Mime
View raw message