Case study 04 — Anlytic
Letting idle resources sleep, safely
Releasing what is not being used, and bringing it back so transparently that nothing notices.
Idle
released automatically
1
route back
Safe
across replicas
The problem
Idle sources held resources open indefinitely and were billed for it. Reclaiming them is the easy half. Bringing them back is the hard one: it has to happen from any entry point, under concurrency, across replicas, without anyone seeing an error.
How it fits together
What I did
Track, then release
Activity is recorded per source. Quiet ones are marked and their resources released, while the data itself is left completely alone.
One route back
Resume is centralised behind a single call, so every kind of request behaves identically. A warm connection passes straight through and costs nothing.
One winner
When several replicas arrive at once, coordination ensures one does the work and the others wait for its result rather than repeating it.
The hard part
One route, not several. The temptation is to handle resume wherever each caller happens to need it, which produces four implementations and three of them are subtly wrong.
This releases and restores connection resources. The underlying data is never stopped or removed.
Stack
Written at the level the reasoning survives. Internal specifics are left out on purpose.