nerdexam
GoogleGoogle

PROFESSIONAL-CLOUD-DEVELOPER · Question #276

PROFESSIONAL-CLOUD-DEVELOPER Question #276: Real Exam Question with Answer & Explanation

The correct answer is A: Modify the query that returns the product list using cursors with limits.. A cursor is a pointer to a specific location in a Firestore database. By using cursors with limits, you can control the number of documents that are returned in a query. This can help to reduce the number of Firestore queries that are made, which can improve performance and preve

Optimizing Application Performance

Question

You are a lead developer working on a new retail system that runs on Cloud Run and Firestore. A web UI requirement is for the user to be able to browse through all products. A few months after go-live, you notice that Cloud Run instances are terminated with HTTP 500: Container instances are exceeding memory limits errors during busy times. This error coincides with spikes in the number of Firestore queries. You need to prevent Cloud Run from crashing and decrease the number of Firestore queries. You want to use a solution that optimizes system performance. What should you do?

Options

  • AModify the query that returns the product list using cursors with limits.
  • BCreate a custom index over the products.
  • CModify the query that returns the product list using integer offsets.
  • DModify the Cloud Run configuration to increase the memory limits.

Explanation

A cursor is a pointer to a specific location in a Firestore database. By using cursors with limits, you can control the number of documents that are returned in a query. This can help to reduce the number of Firestore queries that are made, which can improve performance and prevent Cloud Run from crashing.

Topics

#Firestore#Cloud Run#Pagination#Performance Optimization

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER PracticeBrowse All PROFESSIONAL-CLOUD-DEVELOPER Questions