GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 8 of 35
You need to redesign the ingestion of audit events from your authentication service to allow it to handle a large increase in traffic. Currently, the…
Full set: 265 questionsThis scenario requires a scalable, load-balanced system for processing messages. A single Pub/Sub topic serves as a centralized channel for all authentication services to publish audit events, effectively decoupling them from the consumers. A single, shared pull subscription allows the multiple audit service instances to act as a group of competing consumers. Each instance pulls messages from the subscription, and Pub/Sub ensures that any given message is delivered to only one instance for processing. This design distributes the workload evenly and allows the system to scale horizontally by simply adding more audit service instances to the subscriber pool without further configuration changes.
B: Creating a subscription per instance implements a fan-out pattern, causing each audit event to be processed multiple times by every service instance, which is incorrect for this use case. C: While a push subscription with a load balancer is a valid scalable pattern, the pull model is more idiomatic for backend workers on Compute Engine, giving them control over the message consumption rate. D: Creating a topic per authentication service is an anti-pattern that introduces unnecessary complexity and tight coupling, defeating the purpose of a decoupled messaging system. E: This option has the same flaws as D (unnecessary complexity and coupling) and incorrectly suggests a one-to-one mapping between publishers and subscribers, preventing load balancing.
1. Google Cloud Documentation, "Subscriber overview": Under the "Pull subscribers" section, it states, "When multiple subscribers receive messages from the same subscription, they are load-balancing. The subscribers can be running on different virtual machines." This directly validates the architecture described in option A for load balancing among a group of workers.
Source: https://cloud.google.com/pubsub/docs/subscriber, Section: "Pull subscribers".
2. Google Cloud Architecture Center, "Messaging with Pub/Sub for event-driven systems": This document describes common messaging patterns. The "Work queues" pattern is detailed as: "To distribute a workload across a set of workers, you can use a pull subscription. Each worker receives a subset of the messages." This is the exact pattern required by the question.
Source: https://cloud.google.com/architecture/messaging-with-pubsub-for-event-driven-systems, Section: "Common messaging patterns".
3. Google Cloud Documentation, "Receiving messages using Pull": "In a pull subscription, your subscriber application initiates requests to the Pub/Sub server to retrieve messages... This allows the subscriber to control the rate at which it receives messages." This highlights the control that pull subscribers (the audit services) have, which is beneficial for handling large, potentially spiky traffic.
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 1You have an application controlled by a managed instance group. When you deploy a new ver…
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
