QuestionQ235

Designing scalable, available, and reliable cloud-native applications

You are building a flower-ordering application. At present, it has three microservices:

  • Order Service (receives orders)
  • Order Fulfillment Service (processes orders)
  • Notification Service (notifies the customer when an order is filled)

You need to decide how these services will communicate. Incoming orders must be processed quickly, and you need to gather order information for fulfillment. You also need to ensure that orders are not lost between services and that the services can communicate asynchronously. How should the requests be processed?

  • A
  • B
  • C
  • D
Explanation

Google Cloud Pub/Sub is an asynchronous messaging service that decouples producers from consumers. Publishing each order to Pub/Sub lets the Order Service accept requests promptly while the Order Fulfillment Service processes them independently. Pub/Sub retains and redelivers unacknowledged messages, preventing a transient processing failure from losing an order. Firestore provides durable storage for the fulfillment information, and a second Pub/Sub event can asynchronously trigger the Notification Service after fulfillment.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!