01
Service Design
The decisions that determine whether a service is scalable and changeable: moving state out of the service, service discovery through dynamic addressing and health information, the selection criteria for remote procedure call, resource-based, and query-based calling, preserving compatibility through schema evolution, and the effect of timeout and retry budget on total latency in a call chain.
- 01 Stateless Services The effect of moving state out of the service process on horizontal scaling: measuring the same load in two modes with local processes, the session held in a replica's memory splitting across replicas and being lost on restart, reversing the replica count measured in the traffic layer, and computing the cost that moving state outward charges to the state store and the body's byte count.
- 02 Service Discovery Moving replica addresses out of a hand-written list and into a registry: separating service discovery from the load balancer's health check, using a model to measure how much a registration's time to live and the resolution cache extend the window for detecting a failure, graceful shutdown resetting that window, and converting the window into the outage budget measured in the introductory course.
- 03 Communication Styles Writing the same internal call in remote procedure call, resource-based, and query-based styles and comparing them with three measures specific to the service boundary: the number of internal calls made for one external request, the bytes crossing the internal boundary, and the number of names the caller has to know; multiplying the internal byte volume by the introductory course's peak read rate to convert it into internal boundary bandwidth.
- 04 Inter-Service Contracts Measuring the cost of a schema change by the number of broken consumers: counting how many services a single-step release forces to publish together across five internal consumers' read sets, splitting the same change into an expand–contract sequence to bring broken consumers to zero, and computing what carrying two names at once during the transition window costs in record bytes and internal boundary bandwidth.
- 05 Timeout and Retry Budget Splitting the end-to-end latency threshold across the steps in the chain: computing how far the product of timeout and retry count inflates the budget in the worst case, deadline propagation turning a threshold overrun into an early failure, a short timeout absorbing transient slowness, and using a model to measure how far the internal request rate multiplies under widespread slowdown when no retry budget is set.