Reputation: 337
Upvotes: 5
Views: 1878
Reputation: 2958
Materialized Views are considered experimental. The next patch releases of 3.0, 3.11, and 4.0 will include CASSANDRA-13959, which will log warnings when materialized views are created, and introduce a yaml setting that will allow operators to disable their creation. So better avoid using them.
As the original modeling lessons says, duplicate the data into a different table for querying by a different partition key.
But anyways to answer your original questions
1. Would like to know impact of mv on base table. Does it slows down base table? When does it starts writing to mv like does it write to base table and mv same time?
With a materialized view, there is an overhead of read before write. Every write to the base table, involves a read from base table about the corresponding partition key in MV. Then further it writes to the MV with a log based approach, as to make sure the write when applied to base table gets committed in MV as well. So writes will be slower for a table with MV.
2) if I have CL of local_quorum and RF=3 does the client has to wait till it write to mv to get the ack.
The client will not wait for MV writes, as its handled separately by Cassandra with a log based write to MV from the base table. The consistency guarantee is still applicable only for the base table.
3) what kind of lock involved in base table and mv does it impacts the latencies on base table
Instead of locking, Cassandra uses batchlog to guarantee the writes happen to MV from base table.
For further reference on performance impacts on MV.
Upvotes: 7