A voting website receives variable, high-volume incoming votes. How should you optimize storage and processing of incoming votes?
Choose an answer
Tap an option to check your answer.
Correct answer: Publish votes to Pub/Sub and trigger a Cloud Function from the Pub/Sub topic to process them..
Why this is the answer
Publishing votes to Pub/Sub and triggering a Cloud Function is the most suitable solution for variable, high-volume incoming data. Pub/Sub acts as a highly scalable, asynchronous messaging service, decoupling the ingestion of votes from their processing. Cloud Functions are serverless, event-driven compute services that automatically scale to handle fluctuating loads, processing each vote as it arrives. Writing to Firestore and using Cloud Scheduler for periodic processing introduces latency and might not handle high-volume bursts efficiently. Sending all votes directly to a dedicated processing instance lacks scalability and resilience for variable loads. Storing votes as a JSON file in Cloud Storage for daily batch processing introduces significant delays and isn't suitable for real-time or near real-time processing of votes.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed