Rules before conclusions

What each model assumes.

Small examples are useful when their boundaries are visible. Read these assumptions before applying a lesson to a real system.

Request identity needs a receiver contract.

The retry experiment sends the same request identifier twice for one intended background job. With deduplication enabled, the receiver records that identifier together with the job and returns the recorded result on a repeat delivery. The toy model treats those writes as atomic.

A real contract also needs caller scope, parameter comparison and a retention rule. Reusing an identifier with different parameters can require rejection. The AWS Builders Library discussion of idempotent APIs explains those design choices.

An HTTP method's semantics are a separate question. MDN lists POST as non-idempotent by default; an application can add an idempotency contract for a particular operation. See HTTP request method properties.

Modeled
Two sequential deliveries, one caller and one unchanged intended job.
Omitted
Concurrent requests, database crashes, key expiry and payload mismatch handling.

A version number has a defined scope.

The event experiment uses one job and one producer. Its version numbers increase from 1 to 3, and each event describes the complete state of that job at its version. Under those assumptions, accepting only a greater version prevents the late version 2 event from replacing version 3.

This rule does not combine independent updates or resolve conflicting writers. It also does not apply unchanged to incremental events such as "add one item," where skipping a version could omit work. A timestamp from another clock is not automatically a comparable version number.

Modeled
Full-state updates for one entity with a single comparable version sequence.
Omitted
Multiple writers, partial updates, missing events, clock synchronization and stream partitions.

A read carries the history of its source.

The cache experiment holds the authoritative record at version 2 and lets the cached copy hold version 1 or 2. A cached read returns the selected cached version. An authoritative read returns version 2 by definition of this model.

The model contains no timing, replication or invalidation algorithm. It cannot tell you how long a real stale value will remain visible. HTTP cache behavior depends on freshness and validation rules; MDN's HTTP caching guide describes that separate mechanism.

Modeled
A choice between two explicit record copies.
Omitted
Network latency, replica consistency, cache expiry, invalidation delivery and failure recovery.

How to read a trace.

  1. Record the initial state and the rule you selected.
  2. Follow each delivery or read in order. Distinguish the observation from the change it causes.
  3. Check the final state against the stated rule.
  4. Change one assumption and replay the same example.
  5. List the missing mechanisms before applying the idea elsewhere.

The experiments execute deterministic browser code. They do not contact a server, run a distributed test or measure production behavior. Their results demonstrate the rules written here.

Technical sources checked .

Return to the experiments