I hope there's someone who can help me suggest a suitable data model to be implemented using nosql database Apache Cassandra. More of than I need it to work under high loads and large amounts of data.
Simplified I have 3 types of objects:
Product:
key - string key
name - string
.... - some other fields
Tag:
key - string key
name - unique tag words
ProductTag:
product_key - foreign key referring to product
tag_key - foreign key referring to tag
rating - this is rating of tag for this product
Each product may have 0 or many tags. Tag may be assigned to 1 or many products. Means relation between products and tags is many-to-many in terms of relational databases.
Value of "rating" is updated "very" often.
I need to be run the following queries
The most important is to make these queries really fast on large amounts of data, considering that rating is constantly updated.
Something like this:
Products : { // Column Family
productA : { //Row key
name: 'The name of the product' // column
price: 33.55 // column
tags : 'fun, toy' // column
}
}
ProductTag : { // Column Family
fun : { //Row key
timeuuid_1 : productA // column
timeuuid_2 : productB // column
},
toy : { //Row key
timeuuid_3 : productA // column
}
}
UPDATE
Check this Model to store biggest score
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With