Reputation: 20896
I have a SQL table with the following structure -
Ticket_info
ticket_num int
region text
division text
error_count text
PRIMAR KEY (ticket_num,region)
As the ticket db could grow large we are planning to store in cassandra.
The only issue is that the user can query on any of the fields shown above.
I'm planning to denormalize the data as such -
Ticket_info_region
ticket_num int
region text
PRIMAR KEY (ticket_num,region)
Ticket_info_division
ticket_num int
division text
PRIMAR KEY (ticket_num,division)
Ticket_info_error_count
ticket_num int
error_count text
PRIMAR KEY (ticket_num,error_count)
With the above structure I see 2 issues.
Should I manually merge the results if the user gives multiple conditions?
With multiple tables how can I maintain the data integrity. For ex:- after I insert into the region table, if the division table fails, I will have integrity issues.
Upvotes: 0
Views: 197
Reputation: 4061
Do not use cassandra to query all the tables together. If such a condition is necessary use cassandra integrated with solr/elasticsearch. There is a solr implementation available from Datastax.
Use Batch updates for atomic updates. This will ensure that all of your updates are performed and in case of failure, nothing is updated.
Upvotes: 2