You need to reduce read latency for the retail store solution. What are two possible ways to achieve the goal? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point.
A.
Create a new composite index for the store location data queries in Azure Cosmos DB. Modify the queries to support parameterized SQL and update the Azure Function app to call the new queries.
B.
Provision an Azure Cosmos DB dedicated gateway. Update the Azure Function app connection string to use the new dedicated gateway endpoint.
C.
Configure Azure Cosmos DB consistency to session consistency. Cache session tokens in a new Azure Redis cache instance after every write. Update reads to use the session token stored in Azure Redis.
D.
Provision an Azure Cosmos DB dedicated gateway. Update blob storage to use the new dedicated gateway endpoint.
E.
Configure Azure Cosmos DB consistency to strong consistency. Increase the RUs for the container supporting store location data.
I think is correct. If your wondering about B: https://learn.microsoft.com/en-us/azure/cosmos-db/dedicated-gateway
And some info from ChatGpt:
A dedicated gateway provides a dedicated endpoint for client applications to communicate with Azure Cosmos DB. By using a dedicated gateway, client applications such as the Azure Function app can reduce network latency and improve overall performance when communicating with Azure Cosmos DB.
When a dedicated gateway is provisioned, it creates a Virtual Network (VNet) peering between the gateway and the Azure Cosmos DB account. This ensures that all traffic between the client application and Azure Cosmos DB remains within the same network, reducing the network latency.
Correct answer is A and B.
"When you provision a dedicated gateway, an integrated cache is automatically configured within the dedicated gateway."
So no need to use redis.
Ref: https://learn.microsoft.com/en-us/azure/cosmos-db/dedicated-gateway#overview
A) Creating a composite index tailored to the queries used by the application can significantly improve query performance and reduce RU consumption. Modifying the queries to support parameterized SQL can also help optimize query execution.
B) A dedicated gateway in Azure Cosmos DB provides a consistent low-latency connection and can offload some of the query processing workloads from the client. This can help reduce read latency, especially for complex queries and under scaling conditions.
A & B
A. Create a new composite index for the store location data queries in Azure Cosmos DB. Modify the queries to support parameterized SQL and update the Azure Function app to call the new queries:
By creating a composite index tailored to the specific queries used, you can potentially reduce the query cost and improve performance. Parameterized queries can further improve efficiency.
B. Provision an Azure Cosmos DB dedicated gateway. Update the Azure Function app connection string to use the new dedicated gateway endpoint:
A dedicated gateway in Azure Cosmos DB provides improved performance for query execution and can reduce latency. Connecting the Azure Function app to this dedicated gateway can leverage these performance improvements.
A and C
B & D are off due to Azure Cosmos DB dedicated gateway not supporting SQL queries. See limitations on:
https://learn.microsoft.com/en-us/azure/cosmos-db/dedicated-gateway#dedicated-gateway-in-multi-region-accounts
E. Makes no sense as increasing consistency to Strong only makes the reads slower
Thus A & C which makes sense: Composite Index in Cosmos DB and Redis Cache for reads
https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/getting-started
In Azure Cosmos DB for NoSQL accounts, there are two ways to read data:Point reads& SQL queries
https://learn.microsoft.com/en-us/azure/cosmos-db/dedicated-gateway#dedicated-gateway-in-multi-region-accounts
Dedicated gateways are only supported on API for NoSQL accounts
So dedicated gateway is support NoSQL account.How do you found that Azure Cosmos DB dedicated gateway not supporting SQL queries?
Redis is clearly a correct option if using Session consistency. From the following document it is clear that the session-id can be used in a cookie for multiple client-instances to share the same session. That is a clear case for redis-cache. So, if Session consistency is correct then redis cache is also correct. https://docs.microsoft.com/en-us/azure/architecture/solution-ideas/articles/data-cache-with-redis-cache
"Parameterized SQL provides robust handling and escaping of user input, and prevents accidental exposure of data through SQL injection"
So, it does not give performance improvements. Maybe a trick to confuse the traditional sql guys (at least the Java ones, who use that for performance). A trick to punish the Java guys (non-microsoft, I guess. Don't be evil, Microsoft).
Dedicated gateway is a fine option with integrated cache. But otherwise increases latency with an extra hop if using a gateway (either standard or dedicated).
So, another Microsoft gem to create total confusion. An ill conceived question that is half baked
"Connecting to Azure Cosmos DB with the dedicated gateway provides lower and more predictable latency than connecting to Azure Cosmos DB with the standard gateway." But worse than a direct connection unless the cache is used. Probably that is the guessing game we have to do with a lot of assumption thinking that the location data can be cached.
I will bet on B (dedicated gateway) and E (Strong consistency with increased RUs). Strong consistency because that will make the writes do synchronous and so reads can be with lesser consistency level.
This is very innovative answer, but then I can only hope. It cannot be session consistency. It cannot be parameterized sql (unless the Microsoft guys does not understand that it does not increase performance)
B and C are correct.
Not using Strong consistency (or bounded staleness is good for read latency), I
Redis cache can be used to store session information. But that is about web sessions. But I guess this also can be stored in Redis.
Strong consistency as default will make sure the writes are synchronized. But this is about the read latency. While reading any consistency less than Bounded staleness will be better for read latency (read on read quoroms).
A = https://learn.microsoft.com/en-us/azure/cosmos-db/index-policy is correct
upvoted 1 times
...
...
This section is not available anymore. Please use the main Exam Page.AZ-204 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
AbdulMannan
Highly Voted 2 years, 7 months agoReyPirata
1 year, 8 months agosurprise0011
2 years agofinnishr
Highly Voted 2 years, 8 months agocecho123
2 years, 7 months agoJobalos009
Most Recent 10 months, 1 week agoFeriAZ
1 year, 2 months agoEliteAllen
1 year, 9 months agophucngueyn
1 year, 11 months agowinterthor4
2 years, 1 month agoadilkhan
2 years, 2 months agocomoon
2 years, 3 months agorotimislaw
2 years, 4 months agoNK203
2 years, 2 months agotoysky731
2 years, 4 months agoOPT_001122
2 years, 5 months agogmishra88
2 years, 7 months agogmishra88
2 years, 7 months agowarchoon
2 years, 1 month agogmishra88
2 years, 7 months agogmishra88
2 years, 7 months agogmishra88
2 years, 7 months agogmishra88
2 years, 7 months agole129
2 years, 8 months agoadilkhan
2 years, 3 months ago