Order Service Responsibility
In a pizza order management system, what is the primary responsibility of the Order service?
- Processing payment transactions.
- Managing delivery driver assignments.
- Handling customer authentication and authorization.
- Creating, updating, and tracking pizza orders.
- Generating marketing reports on popular pizza toppings.
Payment Service Interaction
How does the Payment service typically interact with the Order service after an order is placed?
- It directly updates the Order service's database with payment status.
- It sends an asynchronous message to the Order service indicating payment success or failure.
- The Order service polls the Payment service every second until payment confirmation.
- The Payment service sends a push notification to the customer's mobile app.
- It ignores the order service and waits for a customer to manually verify payment.
Delivery Service Coordination
What event typically triggers the Delivery service to begin processing an order?
- The customer marks the order as 'out for delivery' in their app.
- The Payment service confirms successful payment and sends an event.
- The Order service receives an email from the kitchen staff.
- A cron job runs every hour to assign deliveries.
- The Delivery service scans the Order service database every minute.
Data Sharing Strategy
Which data sharing strategy is generally recommended for microservices like Order, Payment, and Delivery?
- A single, shared database for all services.
- Shared data tables within a single database.
- Each service having its own private database and communicating through APIs or events.
- Duplicating all data across all service databases for redundancy.
- Using a shared file system for storing order details.
Asynchronous Communication
What is the benefit of using asynchronous communication (e.g., message queues) between the Order, Payment, and Delivery services?
- It guarantees that all services always have the latest data.
- It reduces the chance of service failure cascading across the system.
- It simplifies debugging and troubleshooting.
- It ensures that all services are always running on the same server.
- It eliminates the need for API documentation.
API Gateway Purpose
What is the primary purpose of an API Gateway in the context of these microservices?
- To directly manage the database connections for each service.
- To act as a single entry point for external clients, routing requests to the appropriate service.
- To monitor the health of all microservices and automatically restart them if they fail.
- To automatically generate documentation for all APIs.
- To directly process all payments.
Handling Order Updates
If a customer changes their pizza topping after placing the order, which service is primarily responsible for handling this update?
- The Payment service must recalculate the order total.
- The Delivery service needs to reroute the delivery driver.
- The Order service should update the order details and notify relevant services.
- The customer service representative must manually update all databases.
- The Pizza Topping service directly updates the order.
Failure Scenario: Payment Service Down
What should happen if the Payment service is temporarily unavailable when a customer tries to place an order?
- The Order service should immediately reject the order.
- The Order service should queue the order and retry payment processing later.
- The Order service should bypass the Payment service and mark the order as paid.
- The Delivery service should assume payment will be made later.
- The customer's credit card should be charged without authorization.
Delivery Service Communication
How would the Delivery service typically notify the customer that their pizza is out for delivery?
- By directly accessing the Order service database to retrieve customer contact information.
- By calling the Order service API to request customer contact information.
- By sending a direct SMS message without interacting with other services.
- By relying on the Payment service to send the notification.
- By printing a notification and mailing it to the customer.
Scalability
To scale the Pizza Delivery system to handle increased traffic at peak hours, what is the best option?
- Increase the RAM on the single server where all microservices are running.
- Vertically scale the database server.
- Horizontally scale each microservice independently based on its resource usage.
- Disable logging to improve performance.
- Reduce the number of pizza toppings to simplify order processing.