Monolith vs microservices: the latency price
A monolith calls its modules in memory. Services call each other over the network and add 12 ms at each boundary. With six services, p99 is 97 ms against 30.5 ms for the monolith, and the 60 ms target fails. The simulator does not score release speed.
One process · boundaries in the path: 0 · total 10 ms, the limit is 60 ms
Six services · boundaries in the path: 5 · total 70 ms, the limit is 60 ms
Case 1
100 requests/s. Each service boundary adds a 12 ms round trip and 0.3 ms of CPU. p99 must stay below 60 ms with no errors.
| Measure | Goal | One monolith | Six services |
|---|---|---|---|
| p99 latency | under 60 ms | 31 ms Pass | 97 ms Fail |
| Error rate | none | 0% Pass | 0% Pass |
| Monthly cost | 48 USD/mo | 48 USD/mo |
Case 2
The same load with a p99 target of 120 ms. Both pass, so the price of six services is the added latency.
| Measure | Goal | One monolith | Six services |
|---|---|---|---|
| p99 latency | under 120 ms | 31 ms Pass | 97 ms Pass |
| Error rate | none | 0% Pass | 0% Pass |
| Monthly cost | 48 USD/mo | 48 USD/mo |