Azure Storage, Comos DB Flashcards
What is an Azure Cosmos DB account?
An Azure Cosmos DB account is an Azure resource that acts as an organizational entity for your databases. It connects your usage to your Azure subscription for billing purposes.
True or False? Azure Cosmos DB provides different data models
True:
SQL API, MongoDB, CAssandra, Azure Table and Gremlin (graph)
To minimize Cosmos DB latency, what can you do on creating Azure Cosmos DB Account?
Select a location thats near to customers
True or False? In Azure Cosmos DB, you provision throughput for your containers to run writes, reads, updates, and deletes
True
How is Azure Cosmos DB measuring throughput?
With request unit (RU). Request unit usage is measured per second, so the unit of measure is request units per seconds (RU/s)
True or False? You must reserve the number of RU/s you want Azure Cosmos DB to provision in advance, so it can handle the load you’ve estimated, and you can scale your RU/s up or down at any time to meet current demand.
True
True or false: The number of RUs used for a given database operation over the same data varies over time.
False, Azure Comos DB guarantees that the same query on the same data is consistent.
Which of the following options affects the number of request units it takes to write a document?
Size of the document
Item property count
Indexing policy
All of the above
All of the above
Which of the following statements is false about Request Units (RUs) in Azure Cosmos DB?
The cost to read a 1 KB item is approximately one Request Unit (or 1 RU).
Requests are rate-limited if you exceed the number of provisioned RU.
Once you set the number of request units, it’s impossible to modify this number.
If you provision ‘R’ RUs on an Azure Cosmos container (or a database), Azure Cosmos DB ensures that ‘R’ RUs are available in each region associated with your account.
Once you set the number of request units, it’s impossible to modify this number.
Its always possible to change them from 400 to 250000.
In Azure Comos DB, What is a partition strategy?
Because a Database Partition can run out of space, a partitioning strategy enables you to add more partitions to your database when required. This scaling strategy is called scale out or horizontal scaling
True or False? A partition key defines the partition strategy, it’s set when you create a container and can’t be changed
True
In Azure Comos DB, What is a partition key
A partition key is the value by which Azure organizes your data into logical divisions
Read Again:
When you’re trying to determine the right partition key and the solution isn’t obvious, here are a few tips to keep in mind.
Don’t be afraid of choosing a partition key that has a large number of values. The more values your partition key has, the more scalability you have.
To determine the best partition key for a read-heavy workload, review the top three to five queries you plan on using. The value most frequently included in the WHERE clause is a good candidate for the partition key.
For write-heavy workloads, you’ll need to understand the transactional needs of your workload, because the partition key is the scope of multi-document transactions.
OK
True or false: You can add a partition key to an Azure Cosmos DB container after it has been created.
False, You can set the partition key only when the container is created.
Your organization is planning to use Azure Cosmos DB to store vehicle telemetry data generated from millions of vehicles every second. Which of the following options for your Partition Key will optimize storage distribution?
Vehicle Model
Vehicle Identification Number (VIN) which looks like WDDEJ9EB6DA032037
Vehicle Identification Number (VIN)
True or False? Core (SQL) API is the default Api for Azure Cosmos DB
True
True or False? Core (SQL) API: You can query hierarchical JSON documents with a SQL-like language
True
True or False? at the lowest level Cosmos DB Stores Data in ARS Format (atom-record-sequence) and APIs are just ways to access and modify those.
True
Best API for creating projects from Scratch using Cosmos DB?
Core (SQL)
Best Approach when there is existing DB?
Use the appropriate technology, like Mongo or Cassandra or Gremlin. What ever fits best in the project environment
What API fits best for Azure Comos DB when Data consists of Key-value pairs
Earlier Redis and Table API, but today best fit is Core (SQL) because of richer query experience with improved indexing
What should be the key requirement when deciding for Gremlin
Gremlin (graph) is good when Relations between items have to be made. Like “How is this item related to that item”
A good example is a shop recommendation engine.
How to determine the best fiting Comos DB Api based on a Problem description?
1) Is data unstructured?
2) Is there any existing technology used? If so, probably use even if there is a better choice to reuse code / reduce migrating time because of tech shift
3) Is migration downtime a issue? If not, prefer the better choice instead of 2)
What is CQL referring to?
Cassandra Query Language
When to use Azure Table?
When migrating from earlier Apis like Azure Table Storage or Redis. Then this is preferred instead of Core (SQL) when no downtime is wanted
The e-commerce application has a requirement to support a shopping basket. Customers can add and remove products, and any discounts (like buy one get one free) need to be kept in the basket. The sales team wants the flexibility to offer different kinds of discounts, and to add or remove different product categories.
This type of data is modeled best by documents. Core (SQL) is the best choice for a new system.
The risk department has asked if the new project could implement some form of fraud detection and prevention. The guidance is that the fraud system would need to be able to track the relationship between customers, payment types, billing and delivery addresses, IP address, geolocation, and past purchase history. Anything that doesn’t fit into normal behavior should be flagged.
Complex relationships, and needed to store metadata against them is best supported by a graph mode of data.
The sales team would like to offer a chat feature for customers. Messages will have a fixed number of characters and be simple. The schema is fixed, and the sales team has an existing chat app for which they have built up many CQL statements for creating reports. They would like to reuse them if possible.
The need to reuse existing CQL queries means that Cassandra is the best choice for in this scenario.