Synchronous Ticket Reservation Architecture on Google Cloud
Short answer
D Submit the seat reservation in an HTTP POST request to an Application Load Balancer to enable synchronous processing via a Compute Engine managed instance group.
Question
Key Takeaways
This question explores designing a synchronous ticket ordering process using an Application Load Balancer and Compute Engine managed instance groups. Option D is correct because it provides immediate HTTP-based confirmation, unlike asynchronous alternatives involving queues or events.
Expert Analysis
The scenario requires immediate, synchronous confirmation of a seat reservation for customers using a website. This implies the need for a low-latency, stateful interaction where the client expects a direct response from the backend service handling the transaction. The correct approach must support real-time request/response patterns with high availability and scalability.
HTTP-based load balancing enables synchronous order processing via managed instance groups
Option D correctly addresses the requirement by submitting the seat reservation through an HTTP POST request to an Application Load Balancer (ALB), which then distributes the traffic to a Compute Engine managed instance group. This architecture supports synchronous communication, allowing the ALB to forward the request to a healthy VM in the instance group and return the result directly to the user. Managed instance groups provide automatic scaling and health checking, ensuring that the service remains available during peak ticket purchasing periods. The use of an ALB allows for layer-7 routing, SSL termination, and integration with other Google Cloud networking features, making it suitable for web applications requiring immediate feedback. While Compute Engine instances are virtual machines rather than serverless containers, they offer full control over the runtime environment and can be optimized for specific application needs, such as complex seat-locking logic or legacy codebases. The synchronous nature of this design ensures that the customer receives immediate confirmation, aligning with the business requirement of providing real-time updates on seat availability and reservation status. This pattern is widely used in e-commerce platforms where consistency and immediate user feedback are critical.
Serverless alternatives introduce latency or complexity unsuitable for immediate confirmation
Options A, B, and C propose asynchronous or event-driven architectures that do not meet the requirement for immediate confirmation. Option A uses Cloud Tasks and Workflows, which are designed for background processing and orchestration, not for serving real-time user responses. The delay introduced by queueing and workflow execution would prevent instant feedback. Option B utilizes Pub/Sub and Eventarc, which decouple the producer from the consumer. While this improves scalability and fault tolerance, it introduces eventual consistency, meaning the user would not receive immediate confirmation. Option C relies on Cloud Storage triggers and Cloud Run, which also follows an event-driven model. Although Cloud Run is serverless and scales well, the trigger mechanism means the processing happens after the file upload, resulting in a delay. These options prioritize decoupling and reliability over responsiveness, making them inappropriate for scenarios where the user expects an immediate answer. Understanding the distinction between synchronous and asynchronous processing is crucial when designing systems for real-time interactions.
Asynchronous conditions would favor event-driven architectures over direct HTTP calls
If the requirement were to process reservations in the background without affecting the user experience, such as sending email confirmations or updating analytics, then options A, B, or C might be appropriate. For example, if the system could tolerate a delay in confirmation and needed to handle massive spikes in traffic by offloading processing, an event-driven approach with Pub/Sub or Cloud Tasks would be better suited. Additionally, if the reservation logic involved multiple steps that could fail independently, an orchestrator like Workflows would provide better error handling and retry mechanisms. However, since the question explicitly states the need for "immediate confirmation," any solution that introduces queuing, file uploads, or event triggers is disqualified. The condition of immediacy forces the selection of a synchronous path, ruling out all asynchronous alternatives regardless of their scalability benefits. Candidates must carefully evaluate the timing requirements specified in the scenario to choose the right architectural pattern.
Synchronous HTTP requests to scalable backends ensure consistent user experience
When designing cloud-native applications for real-time interactions, always prefer synchronous HTTP-based communication over asynchronous event-driven patterns unless background processing is explicitly required. Use managed instance groups or serverless services behind a load balancer to handle incoming requests and provide immediate responses. Evaluate the latency constraints: if users expect instant feedback, avoid queues, topics, or storage triggers. Instead, configure your load balancer to distribute traffic evenly across healthy backend instances, ensuring high availability and low latency. This principle applies to e-commerce transactions, live gaming sessions, and any application where user engagement depends on prompt responses. By aligning the architecture with the temporal expectations of the end-user, you create systems that are both performant and user-friendly. Always verify that the chosen technology stack supports the required response time before finalizing the design.
Official Reference
- https://cloud.google.com/load-balancing/docs/https
- https://cloud.google.com/compute/docs/instance-groups
These links open the official vendor documentation in a new tab.
Exam Strategy
Identify keywords indicating timing requirements such as 'immediate', 'real-time', or 'synchronous'. When these appear, eliminate asynchronous options like Pub/Sub, Cloud Tasks, or Cloud Storage triggers. Select the option that uses direct HTTP communication with a scalable backend, such as an ALB connected to managed instance groups or Cloud Run services, to ensure low-latency responses.
Related Analysis
Practice All PCD Questions
Access 84 questions with complete answers and detailed explanations.
View Full PCD Practice Test →