Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
17 views2 pages

Week 7 Reference Solution

The document outlines a microservices architecture for a reservation system, detailing three main services: Reservation, Payment, and Room Availability. Each service has specific responsibilities, such as managing bookings and processing payments, with defined communication methods including asynchronous messaging and synchronous API calls. Additionally, it describes the data managed and sharing protocols for the Payment and Room Availability Services, emphasizing their interaction with the Reservation Service.

Uploaded by

Sahim Bhaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Week 7 Reference Solution

The document outlines a microservices architecture for a reservation system, detailing three main services: Reservation, Payment, and Room Availability. Each service has specific responsibilities, such as managing bookings and processing payments, with defined communication methods including asynchronous messaging and synchronous API calls. Additionally, it describes the data managed and sharing protocols for the Payment and Room Availability Services, emphasizing their interaction with the Reservation Service.

Uploaded by

Sahim Bhaur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Task 1

Each service should handle a specific business function, enabling independent deployment.
Here’s a breakdown of how we could structure this system:

1. Microservices Overview

• Reservation Service.
• Payment Service
• Room Availability Service

2. Service Responsibilities

• Reservation Service:
o Manages room booking requests: checking availability, creating new
reservations, and updating existing bookings
o Communicates with the Room Availability Service to confirm room
availability.
o Communicates with the Payment Service to handle pre-payment verification
and post-payment confirmation for bookings.
• Payment Service:
o Manages transaction processing
o Payment gateways
o Confirming payments, such as sending payment confirmation to the
Reservation Service.
• Room Availability Service:
o Manages room statuses
o Updates availability information based on the booking status
o Ensures the Reservation Service has access to real-time room availability.

3. Communication

• Asynchronous Messaging: Services can use asynchronous communication via a


message broker for event-driven updates. For instance:
o When a reservation is made, the Reservation Service publishes an event that
the Room Availability Service consumes to update room status.
• Synchronous Communication: Services requiring immediate responses (e.g.,
Payment) could use synchronous API calls between services.
Task 2

Payment Service

1. Data Managed:
o Transaction Records: Stores details of each transaction, such as payment
status, amount, date, and a unique transaction ID.
2. Data Sharing:
o Read-Only:
 Reads the reservation status from the Reservation Service (e.g., to
verify that a room is temporarily held before processing a payment).
o Update:
 Updates only its own transaction records.
 Notifies the Reservation Service of the payment outcome (success or
failure) to confirm or release the reservation.

Room Availability Service

1. Data Managed:
o Room Status: Tracks each room’s availability, current status (e.g., available,
reserved, occupied, maintenance requiring).
o Room Configuration: Stores details about each room’s type, capacity, and
features (e.g., deluxe, suite).
2. Data Sharing:
o Read-Only:
 Allows the Reservation Service to read room availability information
to confirm room status during booking creation or modification.
o Update:
 Updates only its own room status data.
 Listens to reservation-related updates from the Reservation Service to
update room availability in response to bookings or cancellations.

You might also like