Cassandra Materialized views impact

别等时光非礼了梦想. 提交于 2021-01-27 08:18:12

问题


  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?
  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.
  3. what kind of lock involved in base table and mv does it impacts the latencies on base table

回答1:


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.



来源:https://stackoverflow.com/questions/48974287/cassandra-materialized-views-impact

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!