System Design Atlas

Hotel inventory and room pricing

08 / 10Worked example

Bottlenecks and trade-offs

Which measurements distinguish business waiting times and technical bottlenecks for room nights?

The sequence is defined; next, we examine its possible bottlenecks. Many searches load the read model; conflicts over the same night arise on the write path. A search cache always includes the offer time and cannot replace confirmation. The following measures are initial design choices that still require testing.

Starting point Channel reconciliation follows the local commit.

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.

Trace symptoms to their causes

Branched diagnostic tree

Slow searchSignal
Measure read-model latencyMeasurement
Rebuild the offer read modelAction
Confirmation collidesSignal
Measure the night hotspotMeasurement
Scale the write path at the measured bottleneckAction
Channel response is missingSignal
Measurement of the order ageMeasurement
Reconciliation based on R-27Action

For each cause, connect the signal, distinguishing measurement and targeted action.

Many searches burden the reading view; conflicts around the same night arise on the writing path. A search cache always carries offer time and does not replace confirmation.

Measure before making changes

SymptomValidationTargeted action
Many searches burden the reading view; conflicts about the same night arise on the writing pathCheck source freshness, the business reason for waiting and processing time separately.Address the evidenced cause first, then retest the same case.
50 requests for the last available nightMeasure the duration of the atomic decision and concurrent access.Move lengthy work outside the commit; preserve the business invariant in the concurrency test.
Stale display despite stored evidenceCompare the authoritative version with the projection version.Rebuild the projection; continue deciding state changes from the authoritative state.

Many searches burden the reading view; conflicts about the same night arise on the writing path

Validation
Check source freshness, the business reason for waiting and processing time separately.
Targeted action
Address the evidenced cause first, then retest the same case.

50 requests for the last available night

Validation
Measure the duration of the atomic decision and concurrent access.
Targeted action
Move lengthy work outside the commit; preserve the business invariant in the concurrency test.

Stale display despite stored evidence

Validation
Compare the authoritative version with the projection version.
Targeted action
Rebuild the projection; continue deciding state changes from the authoritative state.

Search results may be older than the data used to decide a booking

Search results may be older than the data used to decide a booking

Search results may be older than the data used to decide a booking.

Many searches burden the reading view; conflicts around the same night arise on the writing path. A search cache always carries offer time and does not replace confirmation.

Many searches burden the reading view; conflicts around the same night arise on the writing path. A search cache always carries offer time and does not replace confirmation. The exercise specifies the input and expected result.

Alternative considered
Adding compute capacity indiscriminately does not resolve missing business evidence.
Trade-off
Multiple measurement points and separate causes increase the diagnostic effort.
Reassess
Use measurements after the targeted change to decide whether further scaling is needed.

Try it yourself

Name two different causes of delay in this case. Choose a measurement for each and justify the first action.

A hint for your attempt

Record the business reason for waiting, source age and technical compute time separately.

Compare with a possible solution
Case-related diagnosis
Many searches burden the reading view; conflicts around the same night arise on the writing path. A search cache always carries offer time and does not replace confirmation. The first step separates these causes based on their own timestamps and conditions.
Hotspot
For 50 requests on the last available night, competing accesses and commit duration are measured. Long external work is removed from the transaction; then the same concurrency test is repeated.

Apply to your project

Which similar display could have two different causes in your project?

Next: Open channel responses belong to the reservation team.