From the course: Microsoft Azure Cosmos DB Developer Specialty (DP-420) Cert Prep by Microsoft Press
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Choose when to use a point operation versus a query operation
From the course: Microsoft Azure Cosmos DB Developer Specialty (DP-420) Cert Prep by Microsoft Press
Choose when to use a point operation versus a query operation
First of all, we remember that the least expensive way to query Cosmos DB in terms of request unit cost are point reads. Now, while these cost less, you need to know that in order to do a point read, you have to specify the item id and the partition key in your query. So you'll need to take that into account directly. Moreover, I've mentioned several times in the past how important choosing the right partition key is and keeping your query scoped where possible to a single logical partition. Single partition queries always cost at least 2.3 RUs even if you know the id in the key. Remember though, that these queries that go into Cosmos DB are deterministic and each time you run the same exact query, you'll be charged the same RU cost. It's deterministic. And then here is a sample SELECT statement where we're just bringing some raw filtering with complex WHERE clause, WHERE and AND, pretty straightforward. But because we're not…
Contents
- (Locked)Learning objectives1m
- (Locked)Choose when to use a point operation versus a query operation1m 41s
- Implement a point operation that creates, updates, and deletes documents3m 15s
- (Locked)Implement an update by using a operation2m 48s
- (Locked)Manage multi-document transactions using SDK transactional batch2m 1s
- (Locked)Perform a multi-document load using SDK bulk1m 33s
- (Locked)Implement optimistic concurrency control using ETags2m 25s
- (Locked)Implement session consistency by using session tokens1m 28s
- (Locked)Implement a query operation that includes pagination2m 3s
- (Locked)Implement a query operation by using a continuation token1m 21s
- (Locked)Handle transient errors and 429s2m 36s
- (Locked)Specify TTL for a document1m 18s
- (Locked)Retrieve and use query metrics8m 5s
- (Locked)