Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accumulating Materialized Views In Cassandra.

Tags:

cassandra

Hi as I am new to Cassandra I am reading some books, docs, and blog posts to get myself familiar with it. Now I would like to get some answer to how to implement "Accumulating Materialized Views In Cassandra" and by that I mean : Suppose that we have the following model Game { userId, gameName, time,gameMoney .... , etc. } If I want to "Aggregate" games by userId, gameName, I will need denormalize the table to some Materialized View, where the same data is stored but in different model.

What I want is when some record is inserted into the first table a record is inserted in the materialized view or it is update and accumulated if exist.

For example :

Game { 1,gameOne,12:00,1.2}  
Game {1, gameTwo, 12:00, 2.3} 
Game {1,gameTwo,11:00, 2.3}

In the denormalized Materialized View, I want to have two record ( an aggregation by userId and game name) that will look like

UserGames { 1,gameOne,1.2 } 
UserGames {1,gameTow, 4.6 }

I know about triggers but curious if there are some other ways to accomplish that ?

like image 607
Adelin Avatar asked Nov 28 '25 23:11

Adelin


1 Answers

Aggregating materialized views are still not implemented. Here is the relevant Jira ticket and a video explaining how the feature would look like.

Depending on how much data you'll have, you could consider using aggregates.

like image 140
Duarte Nunes Avatar answered Dec 02 '25 04:12

Duarte Nunes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!