2015-10-21

I have a photo application where users can add an album to a queue so that he can watch it later.

On each album page they will see "Watch Later" button.

My question is how to design my table for this in Cassandra.

I only need to store album id, album author, album title, display order and date added in the WatchLater table.

Option 1:
Copy these values on click and write in the WatchLater table

Pros:
1) When showing user's watch list, just read from this table

Cons:

1) User may delete the album or change the title anytime. Many users can add a particular album to watch list. During an update of title, I would need to update WatchLater table entries as well.

2) Need another index to find which rows to update

Option 2:
Only keep the ids, date added and order in WatchLater table
When showing user's watchList, first get the ids from WatchLater table and then use these ids to pull Album title, author from Albums table

Pros:
No need to worry about update of album Title

Cons:
I need to run 2 queries. So it will be little slower.

Assume that frequency of updating title is not that high.

Which option do you recommend?

Show more