Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Why Is It Designed This Way?

Why build stacks from targets?

Policy, metrics labels, TLS identity, routing, and connection behavior vary by port, route, destination, and endpoint. Instantiating a specialized service when the target becomes known moves lookup work out of every request.

Why make readiness separate from calls?

Capacity can disappear before a request is accepted. Polling readiness lets queues, balancers, pools, and overload policies cooperate without taking ownership of work they cannot serve.

Why use static Tower composition so heavily?

The data plane executes these wrappers for every request. Generics preserve request/response relationships, inline layers, and surface invalid ordering or missing target parameters during compilation.

Why cache services by target?

Discovery streams, connection pools, EWMA load, and retry budgets are stateful. Rebuilding them per request would discard learning and multiply control-plane subscriptions. Idle eviction bounds retained cardinality.

Why use watch for policy and credentials?

Consumers need current configuration, not every historical intermediate value. Latest-value delivery prevents slow data-plane consumers from creating an unbounded control-plane backlog.

Why bound queues and add failfast?

An unbounded queue turns an outage into memory growth and enormous tail latency. A small queue absorbs transients; a deadline exposes sustained unavailability so upstream systems can apply their own policy.

Why are retries route-aware and budgeted?

Retries multiply load precisely when a service is failing. Response classes express application semantics; replay limits protect memory; budgets prevent a local recovery mechanism from becoming a mesh-wide retry storm.

Why drain instead of aborting tasks?

Requests may already have passed policy, changed remote state, or begun a streaming response. Stopping admission and letting ownership reach natural end-of-stream gives protocols a coherent completion boundary.