Airbnb 00:00:01 A Paris apartment can be nearby and still be unavailable Maya needs an apartment for two in Paris, arriving March fifteenth and leaving March twentieth. In this illustrative home-rental marketplace, searching for a candidate and authorizing the booking are two different jobs. City, party size, arrival and departure define the search. "Paris apt" becomes the place Paris, France (48.86, 2.35), radius 25 km, type apartment. A synonym list knows apt and flat. Cells near the centre first, then exact distance, guests, type, active. Each listing's bits are compared with a mask of five nights. About 300 remain. Add the applicable nightly prices, fees and tax before deciding whether the stay is inside Maya's budget. Cheap geographical filtering narrows the list. Exact distance, availability and the total price answer the guest's actual question. A cached result is useful for browsing, but it cannot promise that five nights remain free. 00:01:14 Five nights occupy five bits Mark a free night with one and an unavailable night with zero. Line up the requested-date mask with each apartment's calendar. Which home survives if somebody else needs the seventeenth? 1 is free, 0 is taken. Home A is taken from the 20th, home B on the 17th. March 15 to 20 is five nights: 15, 16, 17, 18, 19. The 20th is for leaving. Home A matches the whole requested mask because all five nights are free. The bit for the 17th is 0, so the result differs from the mask. Home B is out. After A is booked the five bits become 0. The worker does this from the event, seconds later. The departure date is excluded from the requested nights. A booking can take time to reach the search bitmap, so repeat the availability decision at its authoritative owner before accepting money. 00:02:23 A reservation must claim every night Maya selects a listing and retries once when her phone hesitates. Send one logical hold identity with the listing and exact date range. Partial ownership of three out of five nights is not a useful holiday. Listing, dates, guests and an idempotency key. The listing row is locked, five night rows change. Five of five. The quoted total is seven hundred ninety-three euros, and this example hold lasts fifteen minutes. Before asking the payment provider, conditionally move this still-valid hold into a paying state so its expiry worker follows the correct rule. Nights become BOOKED, the booking CONFIRMED, and an outbox event is stored, in one transaction. The example confirms the booking and its publication record together. A separate relay can later update the calendar projection. An email arriving quickly would not establish that the actual night rows were committed. 00:03:29 When two calendars disagree The host uses another calendar as well. Imported blocks arrive periodically instead of sharing the booking database's transaction. A stale external feed can therefore conflict with an already-confirmed local stay. The same transaction that takes nights checks them. Six rows with the state BLOCKED and the source host. The host sees grey days. Every 15 minutes the worker reads the other site's feed. Three new busy nights. One imported block overlaps an existing booking. Preserve the booking in this policy and notify the host. Record where every block came from. Escalate a genuine conflict for resolution instead of silently removing the guest's confirmation. Availability across independent sites has a different freshness boundary from five rows inside one transaction. 00:04:27 A successful charge loses its reply Just after charging the card, the booking server stops. Maya sees silence. Charging again under a new identity could bill her twice, while releasing the nights immediately could leave her paid stay without a room. Before the call, the booking says PAYING with its key. The charge worked, the reply is lost. A job asks the provider about the key, or the webhook arrives. Answer: succeeded. PAYING to CONFIRMED, if it is still PAYING. The second message changes nothing. Reconcile with the payment provider using the stable operation identity. Apply the confirmation only while the local booking is in the expected state. Maya's final answer can survive both stale search results and a repeated payment notification.