You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/cassandra/materialized-views-cassandra.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ Materialized Views when defined will help provide a means to efficiently query a
24
24
You can query a column store without specifying a partition key by using Secondary Indexes. However, the query won't be effective for columns with high cardinality (scanning through all data for a small result set) or columns with low cardinality. Such queries end up being expensive as they end up being a cross partition query.
25
25
26
26
With Materialized view, you can
27
-
1. Use as Global Secondary Indexes and save cross partition scans that reduce expensive queries
28
-
2. Provide SQL based conditional predicate to populate only certain columns and certain data that meet the pre-condition
29
-
3. Real time MVs that simplify real time event based scenarios where customers today use Change feed trigger for precondition checks to populate new collections"
27
+
- Use as Global Secondary Indexes and save cross partition scans that reduce expensive queries
28
+
- Provide SQL based conditional predicate to populate only certain columns and certain data that meet the pre-condition
29
+
- Real time MVs that simplify real time event based scenarios where customers today use Change feed trigger for precondition checks to populate new collections"
30
30
31
31
## Main benefits
32
32
@@ -150,29 +150,29 @@ az rest --method GET --uri https://management.azure.com/subscriptions/{{subscrip
150
150
Once your account and Materialized View Builder is set up, you should be able to create Materialized views per the documentation [here](https://cassandra.apache.org/doc/latest/cql/mvs.html) :
151
151
152
152
However, there are a few caveats with Cosmos DB Cassandra API’s preview implementation of Materialized Views:
153
-
1. Materialized Views can't be created on a table that existed before the account was onboarded to support materialized views. Create new table after account is onboarded on which materialized views can be defined.
154
-
2. For the MV definition’s WHERE clause, only “IS NOT NULL” filters are currently allowed.
155
-
3. After a Materialized View is created against a base table, ALTER TABLE ADD operations aren't allowed on the base table’s schema - they're allowed only if none of the MVs have select * in their definition.
153
+
- Materialized Views can't be created on a table that existed before the account was onboarded to support materialized views. Create new table after account is onboarded on which materialized views can be defined.
154
+
- For the MV definition’s WHERE clause, only “IS NOT NULL” filters are currently allowed.
155
+
- After a Materialized View is created against a base table, ALTER TABLE ADD operations aren't allowed on the base table’s schema - they're allowed only if none of the MVs have select * in their definition.
156
156
157
157
In addition to the above, note the following limitations
158
158
159
159
### Availability zones limitations
160
160
161
-
1. Materialized views can't be enabled on an account that has Availability zone enabled regions.
162
-
2. Adding a new region with Availability zone is not supported once “enableMaterializedViews” is set to true on the account.
161
+
- Materialized views can't be enabled on an account that has Availability zone enabled regions.
162
+
- Adding a new region with Availability zone is not supported once “enableMaterializedViews” is set to true on the account.
163
163
164
164
### Periodic backup and restore limitations
165
165
166
166
Materialized views aren't automatically restored with the restore process. Customer needs to re-create the materialized views after the restore process is complete. Customer needs to enableMaterializedViews on their restored account before creating the materialized views and provision the builders for the materialized views to be built.
167
167
168
168
Other limitations similar to **Open Source Apache Cassandra** behavior
169
169
170
-
1. Defining Conflict resolution policy on Materialized Views is not allowed.
171
-
2. Write operations from customer aren't allowed on Materialized views.
172
-
3. Cross document queries and use of aggregate functions aren't supported on Materialized views.
173
-
4. Modifying MaterializedViewDefinitionString after MV creation is not supported.
174
-
5. Deleting base table is not allowed if at least one MV is defined on it. All the MVs must first be deleted and then the base table can be deleted.
175
-
6. Defining materialized views on containers with Static columns is not allowed
170
+
- Defining Conflict resolution policy on Materialized Views is not allowed.
171
+
- Write operations from customer aren't allowed on Materialized views.
172
+
- Cross document queries and use of aggregate functions aren't supported on Materialized views.
173
+
- Modifying MaterializedViewDefinitionString after MV creation is not supported.
174
+
- Deleting base table is not allowed if at least one MV is defined on it. All the MVs must first be deleted and then the base table can be deleted.
175
+
- Defining materialized views on containers with Static columns is not allowed
176
176
177
177
## Under the hood
178
178
@@ -183,9 +183,9 @@ Azure Cosmos DB Cassandra API uses a MV builder compute layer to maintain Materi
183
183
184
184
### What transformations/actions are supported?
185
185
186
-
1. Specifying a partition key that is different from base table partition key.
187
-
2. Support for projecting selected subset of columns from base table.
188
-
3. Determine if row from base table can be part of materialized view based on conditions evaluated on primary key columns of base table row. Filters supported - equalities, inequalities, contains. (Planned for GA)
186
+
- Specifying a partition key that is different from base table partition key.
187
+
- Support for projecting selected subset of columns from base table.
188
+
- Determine if row from base table can be part of materialized view based on conditions evaluated on primary key columns of base table row. Filters supported - equalities, inequalities, contains. (Planned for GA)
189
189
190
190
### What consistency levels will be supported?
191
191
@@ -214,16 +214,16 @@ Setting table level TTL on MV is not allowed. TTL from base table rows will be a
214
214
215
215
216
216
### Initial troubleshooting if MVs aren't up to date:
217
-
1. Check if MV builder instances are provisioned
218
-
2. Check if enough RUs are provisioned on the base table
219
-
3. Check for unavailability on Base table or MV
217
+
- Check if MV builder instances are provisioned
218
+
- Check if enough RUs are provisioned on the base table
219
+
- Check for unavailability on Base table or MV
220
220
221
221
### What type of monitoring is available in addition to the existing monitoring for Cassandra API?
222
222
223
-
1. Max Materialized View Catchup Gap in Minutes – Value(t) indicates rows written to base table in last ‘t’ minutes is yet to be propagated to MV.
224
-
2. Metrics related to RUs consumed on base table for MV build (read change feed cost)
225
-
3. Metrics related to RUs consumed on MV for MV build (write cost)
226
-
4. Metrics related to resource consumption on MV builders (CPU, memory usage metrics)
223
+
- Max Materialized View Catchup Gap in Minutes – Value(t) indicates rows written to base table in last ‘t’ minutes is yet to be propagated to MV.
224
+
- Metrics related to RUs consumed on base table for MV build (read change feed cost)
225
+
- Metrics related to RUs consumed on MV for MV build (write cost)
226
+
- Metrics related to resource consumption on MV builders (CPU, memory usage metrics)
227
227
228
228
229
229
### What are the restore options available for MVs?
@@ -248,7 +248,7 @@ No. Materialized Views can't be created on a table that existed before the accou
248
248
### What are the conditions on which records won't make it to MV and how to identify such records?
249
249
250
250
Below are some of the identified cases where data from base table can't be written to MV as they violate some constraints on MV table-
251
-
1. Rows that don’t satisfy partition key size limit in the materialized views
252
-
2. Rows that don't satisfy clustering key size limit in materialized views
251
+
- Rows that don’t satisfy partition key size limit in the materialized views
252
+
- Rows that don't satisfy clustering key size limit in materialized views
253
253
254
254
Currently we drop these rows but plan to expose details related to dropped rows in future so that the user can reconcile the missing data.
0 commit comments