Develop for Azure storage Flashcards

1
Q

In Cosmos DB, how do you make sure that there is low latency? [1]

A

You can configure your databases to be globally distributed and available in any of the Azure regions. To lower the latency, [1] place the data close to where your users are. Choosing the required regions depends on the global reach of your application and where your users are located.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

In Cosmos DB, can you add and remove region associated with your account and if so, what other benefit does it have? [2]

A

[1] Yes - With Azure Cosmos DB, you can add or remove the regions associated with your account at any time. [2] Your application doesn’t need to be paused or redeployed to add or remove a region.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In Cosmos DB, - “Azure Cosmos DB transparently partitions your container using the logical **** ** that you specify in order to elastically scale your provisioned throughput and storage”?[1]

A

partition key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In Cosmos DB, what is the term throughput used to describe? [2]

A

In Azure Cosmos DB, “throughput” [1] refers to the amount of work a database container can handle in terms of read and write operations per second. Throughput is a crucial concept in Cosmos DB, as [2] it directly impacts the performance and scalability of your database workloads. Cosmos DB offers two main throughput models: “Provisioned throughput” and “Serverless.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In Cosmos DB, Depending on which API you use, an Azure Cosmos DB item can represent either a……. ?

A

[1]a document in a collection, [2]a row in a table, [3] or a node or [4] edge in a graph.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In Cosmos DB, what is the trade off for using strong consistency? [3]

A

Lover availability
Higher latency
lower throughput

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In Cosmos DB, what is the benefit of using lower consistancy options? [3]

A

Higher availability
Lower latency
Higher throughput

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In Cosmos DB. After you create an account under your Azure subscription, you can manage the data in your account by what? [3]

A

creating databases, containers, and items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In Cosmos DB, When you create a container, you configure throughput in one of two modes, what a are they? [2]

A

Dedicated provisioned throughput mode: The throughput provisioned on a container is exclusively reserved for that container and it’s backed by the SLAs.

Shared provisioned throughput mode: These containers share the provisioned throughput with the other containers in the same database (excluding containers that have been configured with dedicated provisioned throughput). In other words, the provisioned throughput on the database is shared among all the “shared throughput” containers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In Cosmos DB, when you configure the default consistency level what does it apply to? [2]

A

You can configure the default consistency level on your Azure Cosmos DB account at any time. The default consistency level configured on your account [1] applies to all Azure Cosmos DB databases [2] and containers under that account. All reads and queries issued against a container or a database use the specified consistency level by default.

Read consistency applies to a single read operation scoped within a logical partition. The read operation can be issued by a remote client or a stored procedure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In Cosmos DB, what are the characteristics of Strong consistency? [3]

A

Strong consistency offers a linearizability guarantee. Linearizability refers to serving requests concurrently. [1] The reads are guaranteed to return the most recent committed version of an item. [2] A client never sees an uncommitted or partial write. [3] Users are always guaranteed to read the latest committed write.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In Cosmos DB, when is it best to use the APIs for MongoDB, PostgreSQL, Cassandra, Gremlin, and Table? [3]

A

These APIs are best suited if the following conditions are true:

[1] If you have existing MongoDB, PostgreSQL Cassandra, or Gremlin applications
[2] If you don’t want to rewrite your entire data access layer
[3] If you want to use the open-source developer ecosystem, client-drivers, expertise, and resources for your database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In Cosmos DB, what is the C# code to create a new CosmosClient with a connection string?

A

CosmosClient client = new CosmosClient(endpoint, key);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The Database.CreateContainerIfNotExistsAsync method checks if a container exists, and if it doesn’t, it creates it. Only the container ** is used to verify if there’s an existing container. What is used?

A

ID

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does CRUD mean?

A

CRUD (create, read, update, and delete)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the command to login to the Azure via the Azure cli?

A

az login

17
Q

In Cosmos DB, what do stored procedures do?

A

Stored procedures can create, update, read, query, and delete items inside an Azure Cosmos container. Stored procedures are registered per collection, and can operate on any document or an attachment present in that collection.

18
Q

In Cosmos DB, what is the C# code to delete a Database as an asynchronous operation?

A

await database.DeleteAsync();

19
Q

In Cosmos DB, what is the C# code to reads a database from the Azure Cosmos DB service as an asynchronous operation?

A

DatabaseResponse readResponse = await database.ReadAsync();

20
Q

In Cosmos DB, what type of change feed model is generally used? [1]

A

[1] It is recommended to use the push model because you won’t need to worry about polling the change feed for future changes, storing state for the last processed change, and other benefits.

21
Q

In Cosmos DB, can we add user-defined function? [1]

A

Yes

22
Q

In Cosmos DB, what is the C# code to create a new database if one does not exist?

A

// An object containing relevant information about the response
DatabaseResponse databaseResponse = await client.CreateDatabaseIfNotExistsAsync(databaseId, 10000);

23
Q

In Cosmos DB, what are the characteristics of API for Apache Cassandra? [2]

A

[1] The Azure Cosmos DB API for Cassandra stores data in column-oriented schema. Apache Cassandra offers a highly distributed, horizontally scaling approach to storing large volumes of data while offering a flexible approach to a column-oriented schema. API for Cassandra in Azure Cosmos DB aligns with this philosophy to approaching distributed NoSQL databases. [2] This API for Cassandra is wire protocol compatible with native Apache Cassandra.

24
Q

In Cosmos DB, what are change feeds? [1]

A

[1] Change feed in Azure Cosmos DB is a persistent record of changes to a container in the order they occur. Change feed support in Azure Cosmos DB works by listening to an Azure Cosmos DB container for any changes. It then outputs the sorted list of documents that were changed in the order in which they were modified. The persisted changes can be processed asynchronously and incrementally, and the output can be distributed across one or more consumers for parallel processing.

25
Q

In Cosmos DB, what is the C# code to delete a container?

A

await database.GetContainer(containerId).DeleteContainerAsync();

26
Q

In Cosmos DB, what are the two approaches for reading change feed with the push model? [2]

A

There are two ways you can read from the change feed with a push model: [1] Azure Functions [2] Azure Cosmos DB triggers, and the change feed processor library. Azure Functions uses the change feed processor behind the scenes, so these are both similar ways to read the change feed. Think of Azure Functions as simply a hosting platform for the change feed processor, not an entirely different way of reading the change feed. Azure Functions uses the change feed processor behind the scenes, it automatically parallelizes change processing across your container’s partitions.

27
Q

In Cosmos DB, can we add user-defined function? [1]

A

Yes

28
Q

In Cosmos DB, what is the difference between pre-triggers and post-triggers?

A

Pre-triggers are executed before modifying a database item and post-triggers are executed after modifying a database item.

29
Q

In Cosmos DB, can stored procedures handle transactions?

A

Yes. You can implement transactions on items within a container by using a stored procedure.
Remember what Steve used to say about them!

30
Q

In Cosmos DB, what is meant by Bounded execution regarding stored procedures?? [1]

A

[1] All Azure Cosmos DB operations must complete within a limited amount of time. Stored procedures have a limited amount of time to run on the server. All collection functions return a Boolean value that represents whether that operation completes or not

31
Q

In Cosmos DB, what is the Azure CLI command to Create the Azure Cosmos DB account?

A

az cosmosdb create –name <myCosmosDBacct> --resource-group az204-cosmos-rg</myCosmosDBacct>