What should you do?

Your globally distributed auction application allows users to bid on items. Occasionally, users place identical bids at nearly identical times, and different application servers process those bids. Each bid event contains the item, amount, user, and timestamp. You want to collate those bid events into a single location in real time to determine which user bid first. What should you do?
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 isprocessed first.

Download Printable PDF. VALID exam to help you PASS.

4 thoughts on “What should you do?

  1. Reasons for D:
    • Cloud Pub/Sub is a managed service and message-oriented middleware, in other words, it delivers messages.
    “users place identical bids at nearly identical times, and different application servers process those bids.”
    With Pub/Sub you would just need to config publishers 1 from the end users, it will send the bids to the topic and later on you can process these data. So I will eliminate (A)(C) first, you don’t want to manage you own Hadoop or MySQL server if you have a better option and that is Cloud Pub/Sub.
    • There is another key sentence
    “collate those bid events into a single location in real time.”
    Cloud Dataflow (Apache Beam) 2 supports both streaming and batch processing. There is a function called Triggers, you can trigger by data’s event time also same as the time that the user bid on.
    • You don’t want to store these real time data into Cloud SQL 3.
    https://stackoverflow.com/questions/53932773/right-google-cloud-product/53934435

    1. Answer is B. The problem with D is that, suppose two users place identical bids at nearly the same time, bid should be allotted to the user who bids first (event time) and not to the user whose transaction was processed (processing time). This is where D is wrong.

  2. A is out, filesystems are not consistent to do this.
    B looks good, pubsub does not guarantee delivery order, but in the SQL we’ll have all the information WITH the event timestamp and we can sort it there.
    C looks right at first, mysql is ACID compliant, Only one issue, if we update a master mysql database with the information, the master will not be consistent. system A updates, and B updates 30 minutes later…
    D for the same reason, is not correct.

    The trick here is the part where it says “in real time”, that means that you can NOT use pull subscription, you can NOT use periodically nothing. It has to be push. Is B preety sure on this one.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.