Professional Cloud Developer
You recently deployed an API to process hotel room requests. You need to enforce a quota on incoming API requests that allows no more than 1000 API search requests by each customer for every successful booking by that customer. You want the quota to reset every 24 hours. You want to prioritize the speed of the API over allowing exactly 1000 searches for every booking. What should you do?
- A. Configure an Apigee Quota policy with the Synchronous setting set to false. Reset the quota on every booking or when 24 hours have passed.
- B. Store a query counter in a Firestore document that uses the customer ID as the key. Reset the counter to zero when a booking occurs or 24 hours have passed. Deny a search request if the user’s counter is over 1000.
- C. Store a query counter in memory that counts the number of search requests by each customer. Reset the counter to zero when a booking occurs or 24 hours have passed. Deny a search request if the user’s counter is over 1000.
- D. In BigQuery, store a table row for each search and booking request along with the customer ID and current time. Query the table for the number of prior search and booking requests made in the last 24 hours. Deny the search request if the number of prior search requests is 1000 times more than the number of prior booking requests.