Module 07
Case study: hotel search & reservation
- Nightly inventory model & date-range query
Select a stay on a room-type × night grid and watch the GROUP BY … HAVING MIN(available) logic reject any range with even one sold-out night.
- Availability bitmaps & segment trees
AND together per-night city bitmaps for a stay, then switch to a segment tree for long stays and compare the operation counts.
- Search as a derived, eventually consistent view
Search shows a room as available that was just sold, and the booking-time recheck catches it.
- Holds, expiry & booking flow
Place a hold across several nights, let payment fail or the hold expire, and watch total/held/sold counters move and release.