Interfaces
What happens to the same requestKey with another answerHash?
Server time, version and requestKey belong to the command.
Starting point Compare command fingerprints.
Assumptions for the example case
Illustrative design: 50,000 attempts per day, 10,000 simultaneous starts, a 90-minute duration, autosave every 10 seconds and a peak of 1,000 answer writes/s. This gives at most 540 save opportunities per attempt open for the full duration; actual writes depend on changes and batching.
Interfaces
API contracts
- POST
/attempts/V-17/startStart attempt
- Input
- Participant and R-3
- Result
- V-17 in_progress with closesAt
- Retry behaviour
- The same key gives the same attempt
- PUT
/attempts/V-17/answers/A-17Save A-17
- Input
- expectedVersion, answerHash, receivedAt, requestKey
- Result
- New answer and attempt revisions
- Retry behaviour
- identical content gives first result
- POST
/attempts/V-17/submissionSubmit on time
- Input
- expectedVersion, receivedAt, requestKey
- Result
- E-17 and submitted
- Retry behaviour
- identical repetition gives E-17
- POST
/attempts/V-17/extensionExtend the deadline before its current expiry.
- Input
- Exam administration, expectedVersion, the new deadline newClosesAt and the server-side check time observedAt.
- Result
- Only in_progress, a matching version, observedAt < closesAt and newClosesAt > closesAt permit an atomic update of the deadline and incremented version.
- Retry behaviour
- After a lost response, read the current attempt state. Resending the original expectedVersion returns version_conflict; a further extension requires a new decision against the current version.
Terms in this step
- Optimistic version
- A command applies only to the last confirmed attempt state.
Try it yourself
Decide replay or conflict.
A hint for your attempt
A key identifies exactly one payload.
Compare with a possible solution
- Equal
- Return the original save result.
- Other
- idempotency_conflict.
Apply to your project
Define the fingerprint for a file upload.