
Answer-first summary for fast verification
Answer: Have each application server write the bid events to Google Cloud Pub/Sub as they occur. Use a pull subscription to pull the bid events using Google Cloud Dataflow. Give the bid for each item to the user in the bid event that is processed first.
The correct answer is D. The requirement is to collate bid events in real time and determine which user bid first. Google Cloud Pub/Sub is suitable for real-time data ingestion, and Google Cloud Dataflow is designed for real-time processing, enabling the handling of bid events effectively. Using a pull subscription with Dataflow ensures that bid events are processed based on their event time, not merely the order in which they are received, which is important for determining the first bid accurately.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
In your globally distributed auction application, users are able to place bids on various items. There are instances where multiple users place identical bids almost simultaneously, and these bids are processed by different application servers. Each event related to a bid includes data such as the item being bid on, the bid amount, the user who placed the bid, and the timestamp of when the bid was placed. You need to aggregate these bid events into a single repository in real time to accurately determine which user placed their bid first. What steps should you take to achieve this?
A
Create a file on a shared file and have the application servers write all bid events to that file. Process the file with Apache Hadoop to identify which user bid first.
B
Have each application server write the bid events to Cloud Pub/Sub as they occur. Push the events from Cloud Pub/Sub to a custom endpoint that writes the bid event information into Cloud SQL.
C
Set up a MySQL database for each application server to write bid events into. Periodically query each of those distributed MySQL databases and update a master MySQL database with bid event information.
D
Have each application server write the bid events to Google Cloud Pub/Sub as they occur. Use a pull subscription to pull the bid events using Google Cloud Dataflow. Give the bid for each item to the user in the bid event that is processed first.