- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 226字
- 2021-07-03 00:19:23
Materialized views
Data modeling principles in Cassandra compel us to denormalize data as much as possible. Prior to Cassandra 3.0, the only way to query on a non-primary key column was to create a secondary index and query on it. However, secondary indexes have a performance trade-off if they contain high cardinality data. Often, high cardinality secondary indexes have to scan data on all the nodes and aggregate them to return the query results. This defeats the purpose of having a distributed system.
To avoid secondary indexes and client-side denormalization, Cassandra introduced the feature of materialized views, which does server side denormalization. You can create views for a base table and Cassandra ensures eventual consistency between the base and view. This lets us do very fast lookups on each view following the normal Cassandra read path. Materialized views maintain a correspondence of one CQL row each in the base and the view, so we need to ensure that each CQL row that is required for the views will be reflected in the base table's primary keys. Although a materialized view allows for fast lookups on non-primary key indexes, this comes at a performance hit to writes. Also, using secondary indexes and materialized views increases the disk usage by a considerable margin. Thus, it is important to take this into consideration when sizing your cluster.
- 零起步輕松學(xué)單片機(jī)技術(shù)(第2版)
- 大數(shù)據(jù)管理系統(tǒng)
- 網(wǎng)頁(yè)編程技術(shù)
- 數(shù)控銑削(加工中心)編程與加工
- INSTANT Heat Maps in R:How-to
- FPGA/CPLD應(yīng)用技術(shù)(Verilog語言版)
- 中國(guó)戰(zhàn)略性新興產(chǎn)業(yè)研究與發(fā)展·增材制造
- 基于敏捷開發(fā)的數(shù)據(jù)結(jié)構(gòu)研究
- Mastering Exploratory Analysis with pandas
- FANUC工業(yè)機(jī)器人配置與編程技術(shù)
- Learning Cassandra for Administrators
- 伺服與運(yùn)動(dòng)控制系統(tǒng)設(shè)計(jì)
- 信息系統(tǒng)安全保障評(píng)估
- Raspberry Pi 3 Projects for Java Programmers
- R Statistics Cookbook