Exam-Answer

Home / Microsoft / AZ-300 / Question 126

Prev Question
Next Question

Question 126

You create an Azure Function that must connect to a Cosmos DB. Cosmos DB is replicated to the following regions that support read and write:

West Europe

North Europe

West US

West US 2

You need to use a singleton pattern to create a connection to the Cosmos DB.

How many connections to Cosmos DB should the Azure Function establish?

Answers



A B C D

Advertisement

Explanation

The singleton pattern is a widely used software design pattern that limits the instantiation of a class to one object. This is helpful when you need exactly one object to coordinate system actions. Because you want to use the singleton pattern to create connection to the Cosmos DB, you should establish a single connection.

You should not establish two, three or four connections to Cosmos DB, because in that case you would not follow the singleton pattern.

References

Comments

Load more
Prev Question
Next Question