Professional Cloud Developer Exam QuestionsBrowse all questions from this exam

Professional Cloud Developer Exam - Question 94


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 audit service and the authentication system run in the same Compute Engine virtual machine. You plan to use the following Google Cloud tools in the new architecture:

✑ Multiple Compute Engine machines, each running an instance of the authentication service

✑ Multiple Compute Engine machines, each running an instance of the audit service

✑ Pub/Sub to send the events from the authentication services.

How should you set up the topics and subscriptions to ensure that the system can handle a large volume of messages and can scale efficiently?

Show Answer
Correct Answer: AD

Create one Pub/Sub topic. Create one pull subscription to allow the audit services to share the messages. This setup ensures that messages are distributed among multiple audit service instances efficiently and allows the system to scale horizontally. Each audit service can pull messages from the same subscription, which helps to handle a large volume of messages without creating a bottleneck. This approach simplifies the management of topics and subscriptions while providing the required scalability.

Discussion

14 comments
Sign in to comment
gfr892Option: A
Jan 25, 2022

https://cloud.google.com/pubsub/docs/subscriber "Multiple subscribers can make pull calls to the same "shared" subscription. Each subscriber will receive a subset of the messages." Response is A. With C and D you can't scale efficiently, because you have to create a topic for each new instance of the authentication service.

akshaychavan7
Aug 5, 2022

This seems to be a smart answer and follows the logic with which I was thinking.

telpOption: A
Jan 13, 2023

A is correct. This is the most flexible way to scale, allowing the authentication and audit services to be sized independently according to load. B is incorrect. This will cause messages to be duplicated, one copy per subscription. C is incorrect. This will allow the system to scale, but push subscriptions are less suited to handle large volumes of messages. D is incorrect. This will allow the system to scale, however each audit service will listen to all subscriptions. E. is incorrect. This will allow the system to scale, however it will require each audit service to listen to all subscriptions. Also push subscriptions are less suited to handle large volumes of messages.

ParagSanyashivOption: D
Jan 9, 2022

Agree with D

scaenruyOption: C
Jan 9, 2022

I vote C

tomato123Option: A
Aug 20, 2022

A is correct I think

BlueoceanOption: D
Jan 21, 2022

While this can be between C and D , I would go with Option D considering the large volume mentioned in question

zellckOption: A
Dec 21, 2022

A is the answer.

omermahgoubOption: E
Jan 6, 2023

Answer is E, in which there is one topic per authentication service and one push subscription per topic, with the endpoint pointing to one audit service, is a better option because it allows the audit services to scale horizontally to handle a large volume of messages, and it allows the messages to be processed in parallel. Each authentication service will send messages directly to its own topic, which will be handled by a specific audit service. This will ensure that the system can scale horizontally to handle a large volume of messages, and it will also allow the audit services to process the messages in parallel.

omermahgoub
Jan 6, 2023

A, in which there is only one topic and one pull subscription, would not allow the audit services to scale horizontally to handle a large volume of messages, as they would all be pulling messages from the same subscription. If the volume of messages increased, the audit services would not be able to process them all in a timely manner, as they would be competing for messages from the same subscription. B, in which there is only one topic and one pull subscription per audit service, would also not allow the audit services to scale horizontally, as they would all be pulling messages from the same topic

omermahgoub
Jan 6, 2023

D, in which there is one topic per authentication service and one pull subscription per topic, you may encounter issues with scaling efficiently as the number of authentication service instances increases. This is because you would have to create a new topic for each new instance of the authentication service, and each audit service would have to pull messages from a different topic. This would not allow the audit services to process the messages in parallel, as each audit service would be pulling messages from a different topic and processing them sequentially. This could lead to bottlenecks if the volume of messages increased.

omermahgoub
Jan 6, 2023

C, in which there is only one topic and one push subscription with a load balancer endpoint, would not allow the audit services to scale horizontally to handle a large volume of messages. The messages would all be sent to the same endpoint, which would be handled by the load balancer. If the volume of messages increased, the load balancer would not be able to distribute the messages to the audit services in a timely manner, as it would have to process all of the messages itself before forwarding them to the audit services. This could lead to bottlenecks if the volume of messages increased.

closer89Option: A
May 8, 2023

i go for A + custom pubsub metric on autoscale

YochenOption: C
Sep 5, 2023

In my opinion, Option C would be the most efficient way to handle the scenario. Here's why: Single Topic: Having one Pub/Sub topic keeps things simpler and allows all authentication service instances to publish to the same topic. Push Subscription with Load Balancer: This allows incoming messages to be distributed among all available audit service instances. The load balancer would handle distributing the load, making it easier for the audit service to scale out as needed. Option C ensures both scalability and efficient handling of a large volume of messages.

RajanOption: A
Sep 20, 2023

I would go with A.

braskaOption: E
Nov 17, 2023

Option E is a more scalable and efficient solution for handling a large volume of messages and scaling efficiently.

AeglasOption: A
Nov 20, 2023

Most simple and efficient one is A

thewalkerOption: C
Jul 19, 2024

The best approach here is C. Create one Pub/Sub topic. Create one push subscription with the endpoint pointing to a load balancer in front of the audit services. Here's why: Scalability: A single Pub/Sub topic allows you to centralize all audit events. This makes it easy to scale the authentication services by adding more instances without needing to change the Pub/Sub configuration. Load Balancing: Using a push subscription with a load balancer in front of the audit services ensures that the incoming messages are distributed evenly across the available audit service instances. This prevents any single instance from becoming overloaded. Efficiency: Push subscriptions are more efficient than pull subscriptions for high-volume scenarios. This is because the Pub/Sub service actively pushes messages to the subscribers, reducing the need for the audit services to constantly poll for new messages.

thewalker
Jul 19, 2024

Why other options are less ideal: A. Create one Pub/Sub topic. Create one pull subscription to allow the audit services to share the messages. This would create a bottleneck at the single pull subscription, as all audit services would need to compete for messages. B. Create one Pub/Sub topic. Create one pull subscription per audit service instance to allow the services to share the messages. This would be less efficient than push subscriptions and could lead to uneven message distribution. D. Create one Pub/Sub topic per authentication service. Create one pull subscription per topic to be used by one audit service. This would require a lot of topics and subscriptions, making the system more complex to manage. E. Create one Pub/Sub topic per authentication service. Create one push subscription per topic, with the endpoint pointing to one audit service. This would create a one-to-one relationship between authentication services and audit services, which is not scalable.