No. of employees = 100K
No of rooms = 100
consider, 10K employees try to book a room on a single day
Max request per day = 10000 * 100 = 1M
Request Per Second = 10
Storage capacity = employee info * meeting room info = 100 bytes
100 *100 = 10000 bytes = 10KB per day
Per month = 300 KB
GET /show_all_rooms
GET /rooms/available
GET /room/{:id}
/POST /room/book/{:id}
/DELETE /room/cancel/{:booking_id}
Core entities:
Room service:
This service has access to rooms_db from which it can serve list of rooms in the organization, with various filters like rooms in a block, a floor, particular date, particular time period or even based on availability
Calendar Service:
This service is the one responsible to display the calendar in UI with information like booked slot, available slot. UI display it in a weekly, monthly or day view, based on user preference
Booking service:
Handles events like booking a room if already not booked, canceling a room by booking_id. Interacts with bookings_db to fetch the information & update the same.
Notification Service:
Incase of events like booking success or cancellation of booking, sends notification to the user.
Note:
Room Service:
Handles are the incoming request like view room details, booking and cancel request.
The details about the most frequently used rooms cached in Redis and served.
Static room details can be cached in redis
Tech Choices:
What if same user tries to book the same slot two times, this can be handled with idempotency.
Network failure in the downstream can be handled with retry mechanism.