Free DP-420 Exam Braindumps
Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB Questions 31–35 (page: 8)

Updated On: 16-Nov-2026
View Related Case Study

You maintain a relational database for a book publisher. The database contains the following tables.

The most common query lists the books for a given authorId.
You need to develop a non-relational data model for Azure Cosmos DB for NoSQ that will replace the relational database. The solution must minimize latency and read operation costs.
What should you include in the solution?

  1. Create a container for Author and a container for Book. In each Author document, embed bookId for each book by the author. In each Book document embed authorId of each author.
  2. Create Author, Book, and Bookauthorlnk documents in the same container.
  3. Create a container that contains a document for each Author and a document for each Book. In each Book document, embed authorId.
  4. Create a container for Author and a container for Book. In each Author document and Book document embed the data from Bookauthorlnk.

Answer(s): C



View Related Case Study

You have an app named App1 that uses an Azure Cosmos DB for NoSQL database.
App1 uses the spatial columns shown in the following table.

You need to design an indexing strategy for App1.
Which columns can be indexed by using spatial indexes?

  1. Col1 only
  2. Col1 and Col2 only
  3. Col1, Col2, and Col3 only
  4. Col1, Col2, and Col4 only

Answer(s): B

Explanation:

In Azure Cosmos DB for NoSQL, only the Point and LineString data types support spatial indexing. This allows for efficient querying of geospatial data, such as locations (points) and paths (lines). Other data types like Curve, MultiPolygon, and MultiCurve are not supported by spatial indexes in Cosmos DB.



View Related Case Study

HOTSPOT (Drag and Drop is not supported)
You have a container that stores data about families.
The following is a sample document.

You run the following query against the container.

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Note: Each correct selection is worth one point.
Hot Area:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: No
The result is empty, since the cross product of each item from source and an empty set is empty:
Note: Joins result in a complete cross product of the sets participating in the join. The result of an N-way join is a set of N-element tuples, where each value in the tuple is associated with the aliased set participating in the join and can be accessed by referencing that alias in other clauses.
Box 2: No
The cross join is not on the pets.
Box 3: Yes
The cross join is not on the pets.


Reference:

https://docs.microsoft.com/en-us/azure/cosmos-db/sql/sql-query-join



View Related Case Study

Note: This section contains one or more sets of questions with the same scenario and problem. Each question presents a unique solution to the problem. You must determine whether the solution meets the stated goals. More than one solution in the set might solve the problem. It is also possible that none of the solutions in the set solve the problem.
After you answer a question in this section, you will NOT be able to return. As a result, these questions do not appear on the Review Screen.
You have an Azure Cosmos DB for NoSQL database. The database hosts a container named families that stores data in the following format.

You need to return the following data:
● The ID of the family
● The family names of the children
● The name of any pets if the pet is a cat
Solution: You run the following query.

Does this meet the goal?

  1. Yes
  2. No

Answer(s): B

Explanation:

CROSS APPLY should not be used.
Correct:
* You run the following query.

The following Azure Cosmos DB NoSQL query fulfills the requirements by unnesting child array items and filtering the pet array:
To retrieve the family ID, the children's family names, and the rabbit's name, you can use the query below.
SELECT f.id, c.familyName AS FamilyName, p.givenName AS petName
FROM families f
JOIN f.children c
JOIN (SELECT VALUE p FROM p IN c.pets WHERE p.type = 'cat') AS p
1. Flatten the Children Array
To access individual properties within the children sub-array, use a JOIN statement. In Azure Cosmos DB, a JOIN performs an inner product between the document root (f) and the array (f.children). This filters out any family documents that contain no children.
2. Isolate Cat Pets
To inspect the properties of the pets array embedded inside each child, apply a secondary JOIN on c.pets. The WHERE clause then filters these projected items to only include cases where the property $p.type$ matches the string "cat".
3. Project Specific Attributes
The SELECT clause restricts the final JSON output schema to contain exactly three custom-aliased properties: familyId: Extracted from the root document
IDchildFamilyName: Extracted from the current child item iterationpetName: Extracted from the matching pet item iteration
Incorrect:
* You run the following query.

Use two JOINS and one subquery, not three JOINS and a subquery.
* You run the following query.

CROSS APPLY should not be used.


Reference:

https://learn.microsoft.com/en-us/cosmos-db/query/subquery



View Related Case Study

DRAG DROP (Drag and Drop is not supported)
You are designing three apps named App1, App2, and App3. Each app will use a separate Azure Cosmos DB for NoSQL account. The apps have the following consistency requirements:
-App1: Reads must always return the most recent committed version of an item, where the commit occurred during the same session.
-App2: Reads must always return the most recent committed version of an item, even if the commit occurred during another session.
-App3: Write latency must be minimized and data staleness can be tolerated.
You need to recommend a default consistency level for each Azure Cosmos DB for NoSQL account. The solution must minimize concurrency.
What should you recommend for the account of each app? To answer, drag the appropriate consistency levels to the correct apps. Each consistency level may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Note: Each correct selection is worth one point.
Select and Place:

  1. See Explanation section for answer.

Answer(s): A

Explanation:



Box 1: Session
App1: Reads must always return the most recent committed version of an item, where the commit occurred during the same session.
Session consistency
In session consistency, within a single client session, reads are guaranteed to honor the read-your-writes, and write-follows-reads guarantees. This guarantee assumes a single “writer” session or sharing the session token for multiple writers.
Like all consistency levels weaker than Strong, writes are replicated to a minimum of three replicas (in a four replica set) in the local region, with asynchronous replication to all other regions.
Box 2: Strong
App2: Reads must always return the most recent committed version of an item, even if the commit occurred during another session.
Strong consistency offers a linearizability guarantee. Linearizability refers to serving requests concurrently. The reads are guaranteed to return the most recent committed version of an item. A client never sees an uncommitted or partial write. Users are always guaranteed to read the latest committed write.
Box 3: Eventual
App3: Write latency must be minimized and data staleness can be tolerated.
Eventual consistency
Like all consistency levels weaker than Strong, writes are replicated to a minimum of three replicas (in a four replica set) in the local region, with asynchronous replication to all other regions.
In Eventual consistency, the client issues read requests against any one of the four replicas in the specified region. This replica may be lagging and could return stale or no data.
Eventual consistency is the weakest form of consistency because a client may read the values that are older than the ones it read in the past. Eventual consistency is ideal where the application doesn't require any ordering guarantees. Examples include count of Retweets, Likes, or non-threaded comments. The following graphic illustrates the eventual consistency with musical notes.
Incorrect:
* Bounded Staleness
For a single-region account, Bounded Staleness provides the same write consistency guarantees as Session and Eventual Consistency. With Bounded Staleness, data is replicated to a local majority (three replicas in a four replica set) in the single region.
For single-region write accounts with two or more regions, data is replicated from the primary region to all secondary (read-only) regions. For multi-region write accounts with two or more regions, data is replicated from the region it was originally written in to all other writable regions. In both scenarios, while not common, there may occasionally be a replication lag from one region to another.
* Consistent prefix consistency
Like all consistency levels weaker than Strong, writes are replicated to a minimum of three replicas (in a four-replica set) in the local region, with asynchronous replication to all other regions.
In consistent prefix, updates made as single document writes see eventual consistency.
Updates made as a batch within a transaction, are returned consistent to the transaction in which they were committed. Write operations within a transaction of multiple documents are always visible together.


Reference:

https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels



Viewing page 8 of 61
Viewing questions 36 - 40 out of 296 questions


Post your Comments and Discuss Microsoft DP-420 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!