There are arount 100
Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
Admin Panel with restricted privilidges:
1) Creating rooms:
POST: /api/rooms
2) Updating rooms:
PUT: /api/rooms/:roomId
3) Deleting rooms:
DELETE: /api/rooms/:roomId
User:
1) Searching rooms:
GET: /api/rooms
Params: start_from, end_to, equipments, capacity
2) Book room:
POST: /api/rooms/:roomid
Params: start_from, end_to
3) Update/Cancel room:
PUT: /api/rooms/:roomid
return 200 or already booked
Client is connecting via API Gateway (which handles authentication and rate conditions) which than connects to a backend server which handles the operations. Internally it uses Booking Service for reserving rooms (transactions), Availability Service for checking if possible and Notification service once it is done (this is using queue). Cache is being used in Availalability Service when quering data.
This data in Cache is being removed/updated (invalidated) every time some booking occurs to make it consistent.
This should be Postgresql that will handle easily 50 writes/reads per second which is fine for this case. And this should as well use the feature of Posgresql that handles constraints automatically on the DB level.
Cache (Redis, NoSQL key-value) is being used for storing availabilities - this is being asked first and if the data is not there, then database.
Database should have tables like:
Rooms (Id, Name, Building, Floor, Equipment, Capacity), Bookings (Id, From, To, User, DateTime Reserved), Users (UserId, Email)
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.