Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Cassandra provide Materialized Views

I have just started to use Cassandra DB. I want to create materialized views on Cassandra (to store queries) but, after seeking in google, I haven't found any information about it. Maybe it is not permitted in Cassandra?

Well, materialized views in relational DB (Oracle for instance) can be created with the following statement:

CREATE MATERIALIZED VIEW table_mv     
BUILD IMMEDIATE    
REFRESH FAST ON COMMIT     
AS SELECT * FROM tabla;  

Does something similar exist in Cassandra CQL? Or, how can I store a query in a table in Cassandra CQL?

Thanks

like image 976
user3019292 Avatar asked Dec 16 '22 04:12

user3019292


1 Answers

When using Cassandra DB almost all of your tables should essentially be materialized views (IE every table should be the answer to a query you want to preform). You then update them on the application side of your program. Obviously this will require some duplication of data but since writes in Cassandra are cheap this is the preferred way of modeling.

For more information check out these links

C* Summit 2013: The World's Next Top Data Mode https://www.youtube.com/watch?v=HdJlsOZVGwM

http://www.slideshare.net/patrickmcfadin/the-data-model-is-dead-long-live-the-data-model

like image 56
RussS Avatar answered Jan 02 '23 07:01

RussS