What a booking promises

Two customers try to book the last place in a class. Both see availability; one payment reply disappears; another arrives after the reservation expires. A system diagram does not resolve any of these outcomes. Design starts by deciding who may confirm the place and what the customer sees while the result is uncertain.

Describe available, held, paid and cancelled states. Who owns each transition? What if payment arrives after the hold expires? Should the system confirm without a place or refund? These rules determine transaction and integration boundaries.

The class catalogue may tolerate delayed updates while the last-place decision needs a separate check. Different operations can have different guarantees. Choosing one consistency label for the whole product hides the important distinctions.

Traffic around a popular class

Suppose there are 100000 bookings a day. The average is about 1.16 per second, yet opening a popular class can attract hundreds of attempts within seconds. The average does not describe capacity needed for that event.

At 2 KB per main record, new data is approximately 200 MB daily or 73 GB yearly. Indexes, logs, history, backups and replicas add physical storage. Estimate them separately and distinguish measurements from assumptions.

The estimate should lead to concrete questions: how many connections we keep, where a hot row forms, how long customers wait and what storage costs. Multiplying average traffic by ten is not a peak model. That margin might be excessive for the whole service and still insufficient for one popular class.

Who can confirm the last place

If two copies cannot communicate, independently confirming the final place on both risks breaking the promise. One option is to pause confirmation where authority over the place cannot be established. The catalogue can remain available.

This is a decision about a network partition, not a reason to switch off the whole product during any failure. For each operation, we decide whether stale data is acceptable, whether a request can wait for processing or whether the result needs immediate confirmation. Those answers define the availability boundary.

Users also need to observe their own changes. "Booking created" followed by "no booking found" damages trust even if replicas converge later. Specify the guarantees required by these sequences rather than leaving them behind a technical label.

A payment reply goes missing

A payment call times out. The provider may not have processed it, or may have processed it while the reply disappeared. Repeating with a new identifier can create another operation. The customer needs a pending state and the system needs reconciliation.

Define operation identifiers, durable results and conflicting payloads under the same identifier. An idempotent receiver can return the earlier result, but does not create atomicity between your database and an external payment provider.

Handle late payment after cancellation, duplicate events and reordered delivery explicitly. Each needs a path to confirmation, refund, manual review or another status check. An arrow joining two diagram boxes does not capture those decisions.

Amazon’s retry guidance warns that a timed-out call can already have produced a side effect. For this booking flow, retry with the agreed operation identifier and reconcile the existing payment before creating another one.

Restore bookings and payments

Normal availability, acceptable data loss and recovery time are different requirements. RPO expresses the tolerated loss window; RTO expresses a recovery target. Measure actual recovery under the chosen failure scenario.

A one-hour recovery promise includes detection, deciding to switch, startup, data verification and restoring traffic. A quick database command proves only one part. Bookings may also need reconciliation with payments preserved independently by the provider.

RPO and RTO follow a specific failure. Losing one process and losing the entire data store have different effects. Compute may return quickly while records take much longer. One number for every scenario usually hides either expensive excess capacity or a promise the actual recovery process cannot meet.

Google SRE’s data-integrity guidance treats recovery as something to exercise. Here, restored booking rows must also agree with payment outcomes; a running database alone does not prove the customer’s reservation is correct.

Test the failure cases

If one database and a few processes meet the load and guarantees, another service needs a concrete purpose. Every component brings deployments, contracts, monitoring and partial failures to investigate. Team time and operational capacity belong in the constraints too.

We record the decision, alternatives, assumptions and a trigger for revisiting it. Then we test the risk: the last-seat race, a lost payment response, a booking spike or recovery. This gives us reasons why the design fits and when it might stop fitting. Without those checks, the diagram remains an assumption.

  • Send two concurrent requests for the last place. Exactly one valid reservation should win, while the other customer receives a clear refusal without a charge.
  • Lose the successful payment reply, then repeat the request with the same operation identifier. Verify that the previous result is discoverable and no second charge is created.
  • Deliver payment after the hold expires and another customer takes the place. Exercise the agreed refund or review path, including duplicate and reordered events.
  • Load-test one popular class separately from many ordinary classes. Inspect contention on the shared seat record instead of sizing from the daily average.
  • Interrupt communication with the authority that confirms places. Verify the chosen confirmation boundary while the catalogue continues its permitted read behavior.
  • Restore data in a safe environment and reconcile it with preserved payment records. Measure detection, validation and traffic restoration before promising a recovery time.
Back