Booking and inventory flow
How a booking reserves a room and keeps inventory consistent across services.
- Type
- Work
- Role
- Backend developer, Booking Service and Room Inventory
- Status
- Shipped
- When
- 2023 to present
Java 17 Spring Boot Kafka Redis MySQL Spring Data JPA
Problem
Availability had to stay correct while many guests searched and booked the same rooms, without every search hitting the database.
Approach
- Booking Service validates the request and checks availability before confirming.
- Booking events are published to Kafka so Room Inventory updates asynchronously.
- Room availability is cached in Redis and refreshed when inventory events arrive.
- Notification Service consumes the same events to send confirmations.
diagram: booking-inventory-flow
Architecture
Fit shows the whole map. Zoom in, then drag or scroll to explore.
Connections
- Angular client to API GatewayHTTPS
- API Gateway to Booking ServiceREST
- Booking Service to Kafkabooking event
- Kafka to Room Inventoryconsume
- Kafka to Notification Serviceconsume
- Room Inventory to Rediscache
- Room Inventory to MySQLJPA
- Notification Service to SendGridemail
- Notification Service to TwilioSMS