System Design Atlas

Hotel inventory and room pricing

06 / 10Worked example

The overall architecture

How do modules and processes divide responsibility for reservations and external processing?

The local consistency rule determines the boundaries of the reservation API. Channel reconciliation runs separately for deferred work. The modules Offer, Room-night inventory, Reservation, Stay completion organize responsibilities within the API; they are not individually operated services. Guests search through a rebuildable offer read model. The reservation API makes the commitment directly on the relational category-night inventory and stores reservation plus channel order atomically. The channel reconciliation processes distribution channel requests and confirmations separately. Reception uses the same authoritative reservation state for arrival and completion. External channels may only sell via the confirming API path in the example; an independent sale of the same capacity would be an additional open quota contract.

Starting point Cancellation releases the same nights exactly once.

Assumptions for the example case

Own fictitious example design. One hotel, one room category, full nights and a fixed offer in EUR without prepayment. A price offer is valid for 300 seconds; at exactly 300 seconds, a new confirmation is rejected. All figures and test goals are illustrative assumptions.

Runtime components and datastores

Runtime topology · processes, data stores and external systems

Offer read modelEntrance or reading path

Hotel reservations

Reservation APIDomain validation and commit
Category-night inventoryAuthoritative relational data store
Channel reconciliationProcess durably stored work
Distribution channelUse of results
Offer read model → Reservation APIRequest or message
Reservation API → Category-night inventorychange in atomic state
Category-night inventory → Channel reconciliationCommitted task
Channel reconciliation → Distribution channelSubstantiated result

The booking is committed directly against the authoritative category-night inventory; external channels sell only through this confirmation path.

Guests search through a rebuildable offer read model. The reservation API makes the commitment directly on the relational category-night inventory and stores reservation plus channel order atomically. The channel reconciliation processes distribution channel requests and confirmations separately. Reception uses the same authoritative reservation state for arrival and completion. External channels may only sell via the confirming API path in the example; an independent sale of the same capacity would be an additional open quota contract.

Domain responsibilities within the API

Interior view · Reservation API

Process framework · Reservation API

OfferBind version, nights, price and expiry
Room-night inventoryLock category-night rows in order and check remaining inventory
ReservationStore R-27 and the channel request atomically
Stay completionRecord arrival, cancellation and completion according to role
Angebot → Nachtkontingentvalid A-27
Nachtkontingent → ReservierungBoth nights available
Reservierung → AufenthaltsabschlussAuthoritative R-27 state

Offer, volume commitment and stay remain separate responsibilities in the same process.

Reservation API includes offer, room-night inventory, reservation, stay completion. The diagram shows calls between domain modules; modules have no separate server icons.

Map responsibilities to runtime components

Domain taskRuntimeResponsibility
OfferReservation APIFreezes price and validity for selected nights.
Room-night inventoryReservation APITracks available room nights for each room category.
ReservationReservation APIConfirms all nights together and releases them once on cancellation.
Stay completionReservation APIRecords arrival and documented completion of the stay.
Channel reconciliationSeparate background processProcesses stored work and external feedback.
Distribution channelExternal boundaryProvides or confirms the evidence agreed for this case.

Offer

Runtime
Reservation API
Responsibility
Freezes price and validity for selected nights.

Room-night inventory

Runtime
Reservation API
Responsibility
Tracks available room nights for each room category.

Reservation

Runtime
Reservation API
Responsibility
Confirms all nights together and releases them once on cancellation.

Stay completion

Runtime
Reservation API
Responsibility
Records arrival and documented completion of the stay.

Channel reconciliation

Runtime
Separate background process
Responsibility
Processes stored work and external feedback.

Distribution channel

Runtime
External boundary
Responsibility
Provides or confirms the evidence agreed for this case.

Room-night inventory remains with the reservation core

Room-night inventory remains with the reservation core

Room-night inventory remains with the reservation core.

Each confirmed reservation atomically occupies all required nights; occupancy never exceeds the local inventory for its room category.

Room-category inventory per night, offers and reservations must express the same valid state. The exercise specifies the input and expected result.

Alternative considered
A separate service for each module distributes the guarantee “Each confirmed reservation atomically occupies all required nights; occupancy never exceeds the local inventory for its room category” across additional network boundaries.
Trade-off
Common schema changes require coordinated releases.
Reassess
Significantly deviating load from channel reconciliation or independent responsibility justifies a new runtime structure.

Try it yourself

Assign offer, channel reconciliation and distribution channel to the types module, process and external system. Justify the authoritative data store.

A hint for your attempt

A domain responsibility becomes a process only when it has its own execution unit.

Compare with a possible solution
Boundaries
Offer is a module within the reservation API; channel reconciliation is its own process; distribution channel is outside.
Storage
Room-category inventory per night, offers and reservations hold the authoritative evidence. Each confirmed reservation atomically occupies all required nights; occupancy never exceeds the local inventory for its room category. The joint transaction protects this connection; external responses remain separate evidence.

Apply to your project

Which planned service boundary would distribute a currently local guarantee across the network?

Next: Channel reconciliation follows the local commit.