Service boundary cost

Each service boundary adds a network round trip. In the mini board each boundary adds 12 ms. Six separate services add 5 round trips and miss the p99 limit of 60 ms, and a split for checkout only adds 1.

Play a level

See it on the board

The same traffic runs on two boards. The simulator measured both when this page was built.

Board to show
UsersAPI server2 vCPU · 1 GBAPI server2 vCPU · 1 GBAPI server2 vCPU · 1 GBAPI server2 vCPU · 1 GBAPI server2 vCPU · 1 GBAPI server2 vCPU · 1 GB
UsersAPI serv…API serv…API serv…API serv…API serv…API serv…
Six separate services: misses a goal
UsersAPI server6 vCPU · 3 GBAPI server6 vCPU · 3 GB
HTTP/2HTTP/2UsersAPI server6 vCPU · 3 GBAPI server6 vCPU · 3 GB
Core service and a separate checkout: meets the goals
See it on the board
Measure Goal Six separate services Core service and a separate checkout
p99 latency under 60 ms 97 ms Fail 47 ms Pass
Error rate none 0% Pass 0% Pass
Monthly cost 48 USD/mo 48 USD/mo

Key numbers

Network and part values from the catalog. The mini board adds 12 ms for each service boundary.
NumberValue
Round trip inside one zone0.5 ms
Round trip between zones1.5 ms
CPU time for one API call0.3 ms
Each boundary adds a round tripTap, drag or use arrow keys to change the split

Checkout split · boundaries in the path: 1 · total 22 ms, the limit is 60 ms

How it works

A call inside one process costs nanoseconds. A call to another service costs a network round trip: serialization, the wire, queueing and the same again on the way back. Even in one zone this is hundreds of microseconds, and in practice, with the work around it, often several milliseconds. Each boundary also adds a chance to fail.

In the mini board each service boundary adds 12 ms, and a call from the client costs 10 ms. Checkout needs daily releases without a core release, and the limit is p99 below 60 ms with no errors. The same CPU and RAM are available to every design: 12 cores and 6 GB.

The monolith meets the physical limits. It cannot meet the release need, because checkout ships with everything else. Six separate services give checkout its own release, but they add five round trips in a chain, and p99 misses the limit. A narrow split gives checkout its own service and adds one round trip. It meets both needs.

So split along the line of a real need: a team, a release cycle, a scaling difference or a failure wall. Do not split to follow a diagram. Count the calls in the path of one request, and multiply by the cost of a boundary.

If you must split, call in parallel and cut the chain.

In the levels you pick the split that serves the need with the fewest boundaries.