In-band coordination
Which facts can ride on the request for free, and what must hold for that to work?
In-band coordination: the channel that costs nothing
Follow the deadline idea further and a whole family of mechanisms appears. It unifies items usually scattered across many topics.
Things that ride on the request:
- the absolute deadline;
- the trace and span context (identifiers for distributed tracing);
- the tenant and priority;
- the fencing token or epoch (locks, leases and fences);
- the read timestamp that makes a follower read correct (read replicas);
- the retry attempt number;
- the idempotency key.
Every one of these is a fact that two parties must agree on. Every one is agreed without a round trip, without a lookup, and without a registry, because the request is already travelling that way.
The precondition is what makes this a mechanism instead of a habit: in-band state must be interpretable with no shared context.
- An absolute deadline works because both ends share a rough wall clock. A relative interval is meaningless without a starting point, so it does not compose.
- A monotone token works because ordering can be checked locally.
- A tenant ID works because it names something instead of asserting something.
- If the receiver must look something up to interpret a header, the round trip was not avoided. It was moved.
This is "fixed cost gives a natural batch size" in an extreme form. The fixed cost of coordination is spread so thin that it reaches zero, by attaching it to work that was already happening. It is the cheapest coordination in this whole mechanism.
It also explains why context propagation breaking at an asynchronous boundary is such a persistent bug class. Examples are a message queue, a thread-pool handoff and a batch job. The mechanism's entire basis is that the request carries its own context. A hop that rebuilds the request destroys that context.
In short: the request is a free coordination channel, and the only rule is that what rides on it must be interpretable without shared state.