Google Cloud Professional Cloud Developer — Question 107
You manage an ecommerce application that processes purchases from customers who can subsequently cancel or change those purchases. You discover that order volumes are highly variable and the backend order-processing system can only process one request at a time. You want to ensure seamless performance for customers regardless of usage volume. It is crucial that customers' order update requests are performed in the sequence in which they were generated. What should you do?
Answer options
- A. Send the purchase and change requests over WebSockets to the backend.
- B. Send the purchase and change requests as REST requests to the backend.
- C. Use a Pub/Sub subscriber in pull mode and use a data store to manage ordering.
- D. Use a Pub/Sub subscriber in push mode and use a data store to manage ordering.
Correct answer: C
Explanation
The correct answer is C because using a Pub/Sub subscriber in pull mode allows for controlled processing of requests while maintaining the order of operations, essential for handling variable order volumes. Option A and B do not ensure the sequence of processing, and option D, while effective, may introduce latency issues due to pushing requests without guaranteed order.