04 - Develop solutions that use Azure Cosmos DB
138 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is a key benefit of Azure Cosmos DB's global distribution?

  • Unlimited elastic write and read scalability (correct)
  • High latency for reads and writes in all regions
  • Limited availability in case of region unavailability
  • Limitation on the number of regions for global distribution

What does Azure Cosmos DB's multi-master replication protocol enable?

  • Guaranteed consistency level in a single region
  • High latency for reads and writes
  • Limited read and write availability
  • Unlimited elastic write and read scalability (correct)

How does Azure Cosmos DB handle data replication between regions?

  • With consistency level guarantees of the selected level (correct)
  • By increasing latency for reads and writes
  • By restricting database availability
  • By limiting replication to a single region

What happens if one region is unavailable in Azure Cosmos DB's global distribution?

<p>Other regions automatically handle application requests (A)</p> Signup and view all the answers

What is the guaranteed read and write availability with Azure Cosmos DB's global distribution?

<p>99.999% (D)</p> Signup and view all the answers

How quickly are reads and writes served with Azure Cosmos DB's global distribution?

<p>Less than 10 milliseconds at the 99th percentile (C)</p> Signup and view all the answers

What does Azure Cosmos DB's multi-master replication protocol enable?

<p>Every region supports both writes and reads (A)</p> Signup and view all the answers

How does Azure Cosmos DB handle the data replication between regions?

<p>Internally handles with consistency level guarantees (A)</p> Signup and view all the answers

What is the benefit of running a database in multiple regions worldwide with Azure Cosmos DB?

<p>Increases the availability of the database (C)</p> Signup and view all the answers

How can you configure your databases in Azure Cosmos DB to be globally distributed?

<p>Available in any of the Azure regions (B)</p> Signup and view all the answers

What does Azure Cosmos DB provide to lower the latency?

<p>Place the data close to where your users are (D)</p> Signup and view all the answers

What is the fundamental unit of global distribution and high availability in Azure Cosmos DB?

<p>Azure Cosmos DB account (D)</p> Signup and view all the answers

How many Azure Cosmos DB accounts can you create under an Azure subscription by default?

<p>50 (C)</p> Signup and view all the answers

What is the fundamental unit of scalability in Azure Cosmos DB?

<p>Azure Cosmos DB container (A)</p> Signup and view all the answers

How can you manage an Azure Cosmos DB account?

<p>Using the Azure portal, Azure CLI, or language-specific SDKs (D)</p> Signup and view all the answers

What do you use to elastically scale provisioned throughput and storage in Azure Cosmos DB?

<p>Logical partition key (D)</p> Signup and view all the answers

Under which entity are containers grouped in an Azure Cosmos DB account?

<p>Databases (A)</p> Signup and view all the answers

How do you achieve global distribution of data and throughput in Azure Cosmos DB?

<p>By adding and removing Azure regions to your account (D)</p> Signup and view all the answers

What is a database in Azure Cosmos DB analogous to?

<p>A namespace (D)</p> Signup and view all the answers

What is the unit of scalability for provisioned throughput and storage in Azure Cosmos DB?

<p>Container (D)</p> Signup and view all the answers

In Azure Cosmos DB, how are items in a container grouped into logical partitions?

<p>Automatically based on the partition key (A)</p> Signup and view all the answers

What is the mode in which the provisioned throughput on a container is exclusively reserved for that container and backed by SLAs?

<p>Dedicated provisioned throughput mode (D)</p> Signup and view all the answers

By default, how are items added to a container indexed in Azure Cosmos DB?

<p>Automatically without requiring explicit index or schema management (A)</p> Signup and view all the answers

What can an Azure Cosmos DB item represent, depending on the API used?

<p>A document in a collection, a row in a table, or a node or edge in a graph (C)</p> Signup and view all the answers

What is the unit of management for a set of Azure Cosmos DB containers?

<p>Database (C)</p> Signup and view all the answers

In Azure Cosmos DB, how is the throughput on a container evenly distributed across the physical partitions?

<p>Automatically (C)</p> Signup and view all the answers

What does a container in Azure Cosmos DB contain?

<p>Schema-agnostic container of items (B)</p> Signup and view all the answers

In Azure Cosmos DB, what is the mode in which containers share the provisioned throughput with other containers in the same database?

<p>Shared provisioned throughput mode (A)</p> Signup and view all the answers

What are the two extremes of data consistency in Azure Cosmos DB?

<p>Strong consistency and eventual consistency (B)</p> Signup and view all the answers

Which consistency level in Azure Cosmos DB provides the strongest guarantee?

<p>Strong (A)</p> Signup and view all the answers

What does the spectrum of data consistency in Azure Cosmos DB allow developers to do?

<p>Make precise choices and granular tradeoffs (B)</p> Signup and view all the answers

What is the guarantee for all operations regardless of the region from which the reads and writes are served in Azure Cosmos DB?

<p>Consistency levels (B)</p> Signup and view all the answers

What does strong consistency offer in Azure Cosmos DB?

<p>Linearizability guarantee (B)</p> Signup and view all the answers

Where can the default consistency level be configured in Azure Cosmos DB?

<p>On the Azure Cosmos DB account (B)</p> Signup and view all the answers

What does Azure Cosmos DB guarantee for read requests at the chosen consistency level?

<p>100 percent consistency guarantee (D)</p> Signup and view all the answers

What is the fundamental difference between strong consistency and eventual consistency?

<p>Strong consistency offers linearizability, while eventual consistency does not. (A)</p> Signup and view all the answers

What is the scope of read consistency in Azure Cosmos DB?

<p>Scoped within a logical partition (A)</p> Signup and view all the answers

What does the default consistency level configured on an Azure Cosmos DB account apply to?

<p>All databases and containers under that account (C)</p> Signup and view all the answers

What does linearizability guarantee in strong consistency?

<p>Reads return the most recent committed version of an item (A)</p> Signup and view all the answers

What is the default behavior for reads and queries issued against a container or a database in Azure Cosmos DB?

<p>They use the specified consistency level by default (D)</p> Signup and view all the answers

What are the guarantees associated with consistency levels in Azure Cosmos DB?

<p>100 percent of read requests meet the consistency guarantee (A)</p> Signup and view all the answers

What is the unit of management for configuring the default consistency level in Azure Cosmos DB?

<p>Azure Cosmos DB account (A)</p> Signup and view all the answers

What is the minimum value of K and T for a single region account in bounded staleness consistency?

<p>10 write operations or 5 seconds (C)</p> Signup and view all the answers

In session consistency, which guarantees are honored within a single client session?

<p>Consistent-prefix, monotonic reads, monotonic writes, read-your-writes, and write-follows-reads (D)</p> Signup and view all the answers

What is the behavior of updates made as a batch within a transaction in consistent prefix consistency?

<p>Updates are returned consistent to the transaction in which they were committed (A)</p> Signup and view all the answers

What is the characteristic of eventual consistency?

<p>There's no ordering guarantee for reads (D)</p> Signup and view all the answers

What is the ideal scenario for using eventual consistency?

<p>Where the application doesn't require any ordering guarantees (D)</p> Signup and view all the answers

In bounded staleness consistency, how is the 'staleness' configured?

<p>In two ways: The number of versions (K) of the item and the time interval (T) reads might lag behind the writes (A)</p> Signup and view all the answers

What is the guarantee for reads in bounded staleness consistency?

<p>Guaranteed to honor the consistent-prefix guarantee (B)</p> Signup and view all the answers

What is the characteristic of consistent prefix consistency for updates made as single document writes?

<p>See eventual consistency (D)</p> Signup and view all the answers

What is the behavior of write operations within a transaction of multiple documents in consistent prefix consistency?

<p>Always visible together (A)</p> Signup and view all the answers

What is the weakest form of consistency in Azure Cosmos DB?

<p>Eventual consistency (D)</p> Signup and view all the answers

Which API for Azure Cosmos DB is best suited for existing MongoDB, PostgreSQL, Cassandra, or Gremlin applications?

<p>Azure Cosmos DB for MongoDB (B)</p> Signup and view all the answers

In Azure Cosmos DB, which API allows the storage of data in document format?

<p>Azure Cosmos DB for NoSQL (C)</p> Signup and view all the answers

What is the main advantage of using the API for NoSQL in Azure Cosmos DB?

<p>Early access to new Azure Cosmos DB features (A)</p> Signup and view all the answers

Which API of Azure Cosmos DB is best suited for applications that want to use the open-source developer ecosystem and client-drivers?

<p>Azure Cosmos DB for MongoDB (B)</p> Signup and view all the answers

Which API for Azure Cosmos DB implements the wire protocol of open-source database engines?

<p>Azure Cosmos DB for Apache Cassandra (B)</p> Signup and view all the answers

In Azure Cosmos DB, which API is native to the platform?

<p>Azure Cosmos DB for NoSQL (B)</p> Signup and view all the answers

Which API for Azure Cosmos DB is best suited if you have an existing Table application and don't want to rewrite the entire data access layer?

<p>Azure Cosmos DB for Table (A)</p> Signup and view all the answers

What type of data structure does the Azure Cosmos DB API for MongoDB store data in?

<p>Document structure (B)</p> Signup and view all the answers

Which API for Azure Cosmos DB is wire protocol compatible with native Apache Cassandra?

<p>API for Apache Cassandra (C)</p> Signup and view all the answers

In which scenarios is the Azure Cosmos DB API for Gremlin recommended for use?

<p>Involving dynamic data (D)</p> Signup and view all the answers

What is the main advantage of using the Azure Cosmos DB API for Table over Azure Table storage?

<p>Overcomes limitations in latency, scaling, throughput, global distribution, index management, low query performance (D)</p> Signup and view all the answers

What is the key feature of the Azure Cosmos DB API for PostgreSQL?

<p>Managed service for running PostgreSQL at any scale (A)</p> Signup and view all the answers

What is the storage format used by the Azure Cosmos DB API for Cassandra?

<p>Column-oriented schema (A)</p> Signup and view all the answers

What is the primary use case for the Azure Cosmos DB API for MongoDB?

<p>To use the broader MongoDB ecosystem and skills without compromising on using Azure Cosmos DB features (A)</p> Signup and view all the answers

What is the primary benefit of using the Azure Cosmos DB API for Gremlin?

<p>Allows users to make graph queries and stores data as edges and vertices (D)</p> Signup and view all the answers

In Azure Cosmos DB, what does a request unit (RU) represent?

<p>The system resources required to perform database operations (A)</p> Signup and view all the answers

What is the cost of a point read operation for fetching a 1-KB item in Azure Cosmos DB?

<p>1RU (A)</p> Signup and view all the answers

What determines the way consumed RUs get charged in Azure Cosmos DB?

<p>The type of Azure Cosmos DB account being used (D)</p> Signup and view all the answers

In which mode can you provision the number of RUs for your application on a per-second basis in increments of 100 RUs per second in Azure Cosmos DB?

<p>Provisioned throughput mode (D)</p> Signup and view all the answers

What is the primary unit of management for provisioning and scaling throughput in Azure Cosmos DB?

<p>Request units (RUs) (D)</p> Signup and view all the answers

Which API is used to interact with an Azure Cosmos container, and how are costs measured?

<p>All APIs; costs are measured in RUs (D)</p> Signup and view all the answers

What does the mode of provisioned throughput exclusively reserved for a container in Azure Cosmos DB ensure?

<p>The provisioned throughput is backed by SLAs (D)</p> Signup and view all the answers

In which mode do you get billed for the number of request units consumed by your database operations at the end of the billing period?

<p>Serverless mode (A)</p> Signup and view all the answers

Which mode allows you to automatically and instantly scale the throughput (RU/s) of your database or container based on its usage?

<p>Autoscale mode (B)</p> Signup and view all the answers

In which mode are throughput operations exclusively reserved for a container and backed by SLAs?

<p>Provisioned mode (C)</p> Signup and view all the answers

What is the billing model for provisioned throughput at the end of the billing period?

<p>Fixed provisioned throughput model (C)</p> Signup and view all the answers

Which mode is well suited for mission-critical workloads with variable or unpredictable traffic patterns and requiring SLAs on high performance and scale?

<p>Autoscale mode (D)</p> Signup and view all the answers

In which mode do you not have to provision any throughput when creating resources in your Azure Cosmos DB account?

<p>Serverless mode (C)</p> Signup and view all the answers

Which mode allows you to manage the throughput at container and database granularity level?

<p>Provisioned mode (C)</p> Signup and view all the answers

Which method is used to create a container in Azure Cosmos DB?

<p>Database.CreateContainerIfNotExistsAsync (B)</p> Signup and view all the answers

How is an item added to a container in Azure Cosmos DB indexed by default?

<p>By its id property (C)</p> Signup and view all the answers

What is the method used to read an item from a container in Azure Cosmos DB?

<p>Container.ReadItemAsync (D)</p> Signup and view all the answers

Which method is used to delete a database in Azure Cosmos DB?

<p>database.DeleteAsync (A)</p> Signup and view all the answers

How is a query for items under a container created in Azure Cosmos DB?

<p>Container.GetItemQueryIterator (A)</p> Signup and view all the answers

What is required to create an item in an Azure Cosmos DB container using the Container.CreateItemAsync method?

<p>A JSON serializable object with an id property and a partition key (A)</p> Signup and view all the answers

Which method is used to create a database in Azure Cosmos DB if it does not exist?

<p>client.CreateDatabaseIfNotExistsAsync (A)</p> Signup and view all the answers

What is the method used to get a container by ID in Azure Cosmos DB?

<p>database.GetContainer(containerId) (A)</p> Signup and view all the answers

What terms are used in version 3 of the Azure Cosmos DB.NET SDK instead of collection and document?

<p>Container and item (A)</p> Signup and view all the answers

What is the recommended approach for maintaining a CosmosClient in the application to enable efficient connection management and performance?

<p>Maintain a single instance of CosmosClient per lifetime of the application (A)</p> Signup and view all the answers

What can a container be in Azure Cosmos DB?

<p>Collection, graph, or table (D)</p> Signup and view all the answers

What is the content inside a container referred to as in Azure Cosmos DB?

<p>Item (A)</p> Signup and view all the answers

What operation is used to create a new CosmosClient with a connection string?

<p>CosmosClient (A)</p> Signup and view all the answers

What does CosmosClient.CreateDatabaseIfNotExistsAsync do?

<p>Checks if a database exists, and if it doesn't, creates it (A)</p> Signup and view all the answers

What is the primary unit of management for provisioning and scaling throughput in Azure Cosmos DB?

<p>Container (A)</p> Signup and view all the answers

What can stored procedures do in Azure Cosmos DB?

<p>Create, update, read, query, and delete items inside a container (B)</p> Signup and view all the answers

Where are stored procedures registered in Azure Cosmos DB?

<p>Per collection (B)</p> Signup and view all the answers

What does the 'context' object provide access to in Azure Cosmos DB?

<p>All operations that can be performed (D)</p> Signup and view all the answers

What is the purpose of the 'response' object in a stored procedure in Azure Cosmos DB?

<p>Set the body of the response to be sent back to the client (A)</p> Signup and view all the answers

What happens when you create an item using a stored procedure in Azure Cosmos DB?

<p>It's inserted into the Azure Cosmos container and an ID for the newly created item is returned (B)</p> Signup and view all the answers

What are the parameters of the callback function for creating an item in Azure Cosmos DB using JavaScript?

<p>Error object and created object (A)</p> Signup and view all the answers

What happens if a callback isn't provided and there's an error during item creation in Azure Cosmos DB?

<p>The Azure Cosmos DB runtime throws an error (C)</p> Signup and view all the answers

What does setting the description parameter to true in a stored procedure do if the description is missing?

<p>Throws an exception (A)</p> Signup and view all the answers

How are input parameters for stored procedures sent in the Azure portal?

<p>Always as a string (A)</p> Signup and view all the answers

What is the fundamental unit of scalability in Azure Cosmos DB?

<p>Item (C)</p> Signup and view all the answers

How can transactions be implemented on items within a container in Azure Cosmos DB?

<p>By using a stored procedure (A)</p> Signup and view all the answers

What does the continuation value in the transaction continuation model enable in Azure Cosmos DB?

<p>Resuming a transaction from a new starting point (D)</p> Signup and view all the answers

What do all Azure Cosmos DB operations have to complete within?

<p>A limited amount of time (B)</p> Signup and view all the answers

When are pretriggers and post-triggers executed in Azure Cosmos DB?

<p>Pretriggers are executed before modifying a database item, and post-triggers are executed after modifying a database item (D)</p> Signup and view all the answers

How are triggers executed in Azure Cosmos DB?

<p>Triggers must be specified for each database operation where you want them to execute (C)</p> Signup and view all the answers

What is the purpose of the request object in a pretrigger in Azure Cosmos DB?

<p>To manipulate the request message associated with the operation (A)</p> Signup and view all the answers

What value should a pretrigger be created with if it is not permitted to be used in a replace operation?

<p>TriggerOperation.Create (C)</p> Signup and view all the answers

What can a post-trigger do in Azure Cosmos DB?

<p>Query for the metadata item and update it with details about the newly created item (D)</p> Signup and view all the answers

What is the purpose of registering a trigger in Azure Cosmos DB?

<p>To specify the operations that it can run with (B)</p> Signup and view all the answers

What type of parameters can pretriggers have in Azure Cosmos DB?

<p>Pretriggers can't have any input parameters (D)</p> Signup and view all the answers

How is a pretrigger used to validate the properties of an Azure Cosmos item being created?

<p>By adding a timestamp property to a newly added item if it doesn't contain one (C)</p> Signup and view all the answers

What is the action performed by a post-trigger in Azure Cosmos DB?

<p>Updates the metadata item with details about the newly created item (B)</p> Signup and view all the answers

What is the primary reason for using the push model instead of the pull model when reading from the Azure Cosmos DB change feed?

<p>Avoiding the need to poll the change feed for future changes (C)</p> Signup and view all the answers

Which component of implementing the change feed processor in Azure Cosmos DB acts as a state storage and coordinates processing the change feed across multiple workers?

<p>The lease container (A)</p> Signup and view all the answers

What is the purpose of Azure Functions in the context of reading the change feed with a push model in Azure Cosmos DB?

<p>Automatically triggering on each new event in the change feed (A)</p> Signup and view all the answers

What is the main benefit of using the change feed processor in Azure Cosmos DB?

<p>Simplifying the process of reading the change feed (B)</p> Signup and view all the answers

In which scenarios might a developer want the additional low level control of the pull model when reading from the Azure Cosmos DB change feed?

<p>Reading changes from a particular partition key (D)</p> Signup and view all the answers

What is the delegate in the context of implementing the change feed processor in Azure Cosmos DB?

<p>The code that defines what to do with each batch of changes (C)</p> Signup and view all the answers

Which method is used to read from the change feed with a push model in Azure Cosmos DB?

<p>Change feed processor library (A)</p> Signup and view all the answers

What is the main role of the compute instance in the context of implementing the change feed processor in Azure Cosmos DB?

<p>Hosting the change feed processor to listen for changes (C)</p> Signup and view all the answers

What is the primary use of the lease container in the context of implementing the change feed processor in Azure Cosmos DB?

<p>Coordinating processing the change feed across multiple workers (D)</p> Signup and view all the answers

How does Azure Functions relate to the change feed processor when reading the change feed with a push model in Azure Cosmos DB?

<p>It is a hosting platform for the change feed processor (C)</p> Signup and view all the answers

Which model can be used to work with the Azure Cosmos DB change feed by pushing work to a client with business logic for processing?

<p>Push model (B)</p> Signup and view all the answers

What is the current limitation of the change feed in Azure Cosmos DB regarding delete operations?

<p>It doesn't log delete operations (B)</p> Signup and view all the answers

What can be added to an item in Azure Cosmos DB to indicate that it is being deleted, as suggested in the text?

<p>An attribute called 'deleted' with the value 'true' (D)</p> Signup and view all the answers

What is the purpose of setting a time-to-live (TTL) value on an item in Azure Cosmos DB as mentioned in the text?

<p>To ensure automatic deletion of the item (C)</p> Signup and view all the answers

What is the recommended way to work with the Azure Cosmos DB change feed if the client needs to pull the work from the server?

<p>Pull model (A)</p> Signup and view all the answers

In Azure Cosmos DB, how can delete operations be indicated in the change feed without directly logging them?

<p>By adding a soft marker to the items being deleted (D)</p> Signup and view all the answers

What is the purpose of a push model in the context of Azure Cosmos DB change feed?

<p>To push work to a client with business logic for processing (C)</p> Signup and view all the answers

How can the change feed in Azure Cosmos DB be processed to ensure asynchronous and incremental handling of changes?

<p>By distributing the output across one or more consumers (B)</p> Signup and view all the answers

What is the suggested workaround for logging delete operations in the change feed of Azure Cosmos DB?

<p>Adding a soft marker to the items that are being deleted (C)</p> Signup and view all the answers

What is the role of the change feed processor in the push model of Azure Cosmos DB change feed?

<p>Handling the complexity of checking for work and storing state (D)</p> Signup and view all the answers

Study Notes

Azure Cosmos DB Benefits

  • Global distribution enables low latency and high availability
  • Guaranteed read and write availability with global distribution
  • Reads and writes are served quickly, typically within milliseconds
  • Running a database in multiple regions worldwide provides low latency and high availability

Global Distribution and Replication

  • Data is replicated between regions using Azure Cosmos DB's multi-master replication protocol
  • If one region is unavailable, the system automatically redirects to another region
  • The system provides high availability and low latency, even in the event of a regional failure

Configuring Global Distribution

  • Databases can be configured to be globally distributed
  • Containers can be configured to be globally distributed and scalable
  • Throughput can be provisioned and scaled at the container and database level

Units of Scalability and Management

  • The unit of scalability for provisioned throughput and storage is a container
  • The fundamental unit of global distribution and high availability is a container
  • The unit of management for provisioning and scaling throughput is a container or database

Containers and Items

  • A container contains items, which are the fundamental units of data
  • Items can be grouped into logical partitions within a container
  • Items can be added to a container and indexed automatically
  • Items can be read, updated, or deleted using the appropriate methods

Consistency Levels

  • The consistency level determines how closely the data is synchronized across regions
  • The two extremes of data consistency are strong consistency and eventual consistency
  • Strong consistency provides the strongest guarantee, but may have higher latency
  • Eventual consistency provides lower latency, but may have weaker guarantees

Consistency Levels (continued)

  • Bounded staleness consistency provides a trade-off between strong and eventual consistency
  • Session consistency provides a guarantee for a single client session
  • Consistent prefix consistency provides a guarantee for a sequence of updates

API Support

  • Azure Cosmos DB supports multiple APIs, including MongoDB, Cassandra, Gremlin, and PostgreSQL
  • Each API is best suited for specific use cases and applications
  • The API for NoSQL is native to the platform and provides the most flexibility

Request Units and Pricing

  • A request unit (RU) represents the cost of a database operation
  • The cost of a point read operation is 1 RU
  • The cost of other operations depends on the specific operation and the amount of data involved
  • Provisioned throughput can be scaled up or down based on demand

Provisioned Throughput

  • Provisioned throughput can be provisioned at the container and database level
  • The primary unit of management for provisioning and scaling throughput is a container or database
  • Throughput can be provisioned in increments of 100 RUs per second
  • Provisioned throughput can be exclusively reserved for a container and backed by SLAs

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Description

Test your knowledge on Azure Cosmos DB's global distribution with this quiz! Find out about the key benefits, multi-master replication protocol, data replication between regions, handling of region unavailability, guaranteed read and write availability, as well as the speed of reads and writes served.

More Like This

Azure Virtual Machine Scale Sets
18 questions
AZURE TIDE Real Estate Law Quiz
12 questions
Microsoft Azure Cosmos DB - Module 02 Quiz
16 questions
Use Quizgecko on...
Browser
Browser