Scale Estimation:
Organization
Id
Employees
Rooms
Employees
Id
EmpId,
OrgId
Status => Active, InActive
Rooms
Id
Capacity
OrgId,
Type, => Lookup (eg, conference, auditorium etc)
Equipment => Lookup
Id
Name
Code
RoomEquipment
Id
RoomId
EquipmentId
Booking
Id,
EmpId,
OrgId,
RoomId,
StartDate,
EndDate,
Status
Status:
PENDING
RESERVED
CHECKED_IN
COMPLETED
NO_SHOW
CANCELLED
POST /find-rooms => find available rooms
req - {
filters : {
startDate,
endDate,
roomType,
Capacity,
Equipments
}
res - {
List
}
POST /booking => create room booking
req - {
roomId,
orgId,
EmpId,
StartDate,
EndDate
}
res - {
roomId
}
GET /booking/ {booking_id}
res - {BookingObject}
PUT /booking
req - {
status,
startDate,
endDate
]
Async background job - Scans for upcoming reservations in next 30 mins and triggers Reminder Event
Acts as the entry point for all client requests.
Responsibilities:
Distributes traffic across multiple instances of the Read and Write services to improve scalability and availability.
Twillio:
Redis
PostreSQL
We will now deep dive into the following:
1) Ensure no double bookings or overlap bookings
Select * From Room
where RoomId = 22
For Update;
SELECT *
FROM Booking
WHERE RoomId = 22
AND Status = 'RESERVED'
AND StartTime < requestedEnd
AND EndTime > requestedStart;
2) Notification Serivce / Message Queue:
3) Cache invalidation strategies: