
Answer-first summary for fast verification
Answer: Have each application server write bid events to Google Cloud Pub/Sub, and use a pull subscription with Google Cloud Dataflow to pull and process the events, giving the bid to the first user processed
Option A, setting up a MySQL database for each application server and periodically updating a master database, introduces latency and potential consistency issues. Option C, using a shared file with Apache Hadoop, is not suitable for real-time processing due to additional latency and data consistency concerns. Option D, pushing events to Cloud SQL via a custom endpoint, is not ideal for high-throughput real-time operations as Cloud SQL isn't designed for such tasks. Therefore, Option B, leveraging Google Cloud Pub/Sub with Cloud Dataflow for real-time event processing, is the optimal solution for identifying the first bidder in a distributed auction application.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
In a globally distributed auction application, what is the most efficient method to collate bid events from multiple application servers in real-time to determine the first bidder?
A
Set up a MySQL database for each application server to write bid events to, and periodically query each database to update a master MySQL database with the events.
B
Have each application server write bid events to Google Cloud Pub/Sub, and use a pull subscription with Google Cloud Dataflow to pull and process the events, giving the bid to the first user processed
C
Create a shared file and have application servers write bid events to it, then use Apache Hadoop to process the file and identify the first bidder
D
Have each application server write bid events to Cloud Pub/Sub, and push them to a custom endpoint that writes the events to Cloud SQL for real-time collation
No comments yet.