Requirements
Which rule must never be violated even in the case of a high load?
The critical failure is double allocation of S-42. We therefore test the domain invariant at commit. Response time, throughput and error rate are separate operational targets. A fast response establishes a seat entitlement only when the authoritative inventory confirms exclusivity.
Starting point The starting point is the delimited chain S-42 → H-17 → B-17 → T-17.
Assumptions for the example case
Example design for one event with 1,000 numbered seats. Each order contains exactly one seat. Hold, sale, payment and ticket are separate entities. All figures and targets are illustrative assumptions, not provider metrics. Admission scanning, resale, dynamic pricing and multi-seat orders are outside scope. Sources checked on 8 September 2026. The order model covers successful payments, including delayed success; final unpaid cancellations need their own terminal state before implementation.
Check function, invariant and quality goal for S-42 separately
Domain exclusivity, idempotency and operational targets need separate tests
Function
Produce H-17 for S-42The API binds exactly one place and shows expiration time and result.Test: 100 parallel attempts on S-42 produce at most one valid hold.Invariant
Validate allocation at commitOnly a still-valid hold can become a confirmed allocation.Test: Payment after expiration does not generate a second ticket commitment.Quality objective
Handle the launch window33.33 Hold tests/s on average; test tip 100/s.Load Test measures latency, error rates and contention conflicts separately.Idempotency key for an orderSame key and same content give the same result. The same key with altered content ends as a conflict and does not generate another order.
Exclusive seat allocation is an invariant. Response time and throughput are testable assumptions; they do not replace exclusivity.
Functional rules and invariants (functional)
Further reading
| Rule | Behaviour | Evidence |
|---|---|---|
| Active binding | V-17/S-42 has at most one active allocation: a valid hold or confirmed order. converted permanently protects the sold seat. | 100 parallel attempts produce at most one valid hold. |
| Commit Validity | Only H-17 that remains valid at commit can be converted. | Expiry between payment initiation and commit prevents ticket confirmation. |
| Idempotency | Same key and same content give the same result. | Repeat does not create a second order; altered content delivers conflict. |
| Late payment | Successful Z-17 after hold expiry grants no seat entitlement. | B-17 becomes compensation_pending; no T-17 is created. |
Active binding
- Behaviour
- V-17/S-42 has at most one active allocation: a valid hold or confirmed order. converted permanently protects the sold seat.
- Evidence
- 100 parallel attempts produce at most one valid hold.
Commit Validity
- Behaviour
- Only H-17 that remains valid at commit can be converted.
- Evidence
- Expiry between payment initiation and commit prevents ticket confirmation.
Idempotency
- Behaviour
- Same key and same content give the same result.
- Evidence
- Repeat does not create a second order; altered content delivers conflict.
Late payment
- Behaviour
- Successful Z-17 after hold expiry grants no seat entitlement.
- Evidence
- B-17 becomes compensation_pending; no T-17 is created.
Design goals (non-functional)
Further reading
- Starting window
- 20,000 page views and 2,000 hold attempts in 60 seconds are assumptions. Load Test measures retrievals, hold latency and conflict rate separately.
- Test peak
- 100 hold attempts per second are a separate test assumption. It is not derived from the 60-second average.
- Message acceptance
- The webhook response follows durable inbox ingestion. Worker processing time is observed separately from HTTP status.
- Measurable starting targets
- Illustrative test targets: p95 seat-map reads ≤ 500 ms, hold results ≤ 1 s and durable webhook ingestion ≤ 2 s; technical request failures < 1 % in the 60-second window at the test peak. Valid domain 409 conflicts are counted separately. Agree these targets before production; measured evidence is outstanding.
Terms in this step
- Invariant
- An invariant is a business rule that must apply to every permitted state transition.
- Idempotency
- A repetition with the same technical request produces the same effect instead of an additional effect.
- p95
- 95% of the responses measured are within this time. An SLO is an agreed operational goal; the values mentioned here are preliminary test targets.
Try it yourself
Formulate a test for parallel holds, a repeated checkout request and a payment success after H-17 has expired.
A hint for your attempt
For each test, state the expected business effect, not just an HTTP status.
Compare with a possible solution
- Parallelism
- 100 competing holds on V-17/S-42 produce at most one held result. Other attempts conflict or report that the seat is now allocated.
- Idempotency and Expiration
- The same key and checkout payload return the same B-17 result. If Z-17 succeeds after H-17 expires, no T-17 is issued and B-17 becomes compensation_pending.
Apply to your project
What business invariant does your system need in addition to its latency or availability goals?