I'm new to Cassandra. After banging my head against the wall for a few days, things began to make sense, except that.... I always need the PK to perform the query?
So, I considered the following scenario: let's say I'm building a recipes website with thousands of recipes. Each recipe has a title, a list of ingredients and a type(breakfast, lunch, dessert etc) I want to have a search field where I can lookup recipes using any of these three parameters. I can't have all the 3 parameters as PK because I wouldn't be able to search using only one of them [same if I had one as PK and the others as cluster keys]. I understand that secondary index is not a great idea. So, if I want to be able to query recipes by their ingredients, I'll have to create an ingredients table where I put a recipeId followed by a list of the ingredients on each row, right ?
But then, how would I query by ingredient and sort by rating? Should I add the rating to the ingredients table ? Should I be duplicating data that much?
If I wanted to query both by ingredient and type, I would need to perform two separate queries and compare them ?
For the users table: at login I would need to find user by email. Then, other users would search their friends by their name. So I need a different table for login credentials and for user profile ?
Basically, what I have to do is create lots of tables. Is this expected? Is this advisable ?
Should I somehow ingregrate MySQL and Cassandra ?
Thanks in advance.