user3019292
user3019292

Reputation: 41

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

Upvotes: 4

Views: 3476

Answers (2)

ashic
ashic

Reputation: 6495

Materialized views are coming in 3.0:

http://www.datastax.com/dev/blog/new-in-cassandra-3-0-materialized-views

Upvotes: 4

RussS
RussS

Reputation: 16576

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

Upvotes: 8

Related Questions