Splitting an app into services contains damage. A slow feature, a crash loop and a redeploy each hurt checkout badly in one shared app and not at all once checkout ran as its own service. The price on a normal day was about 2.6 ms of extra checkout latency.
One slow feature stopped checkout
Our lab runs a toy shop with checkout, search and recommendations on a virtual clock: 200 requests per second, 16 workers in both designs. When every recommendations call slowed to 2 seconds, it needed 160 workers by Little's law and the shared pool had 16. In the one app, 97.5% of checkouts failed and orders fell from 39.7 to 1.0 per second. In the split version, checkout errors were 0.0% and orders stayed at 39.7 per second.
A monolith can defend against this without splitting. Give each feature its own worker pool, a bulkhead, plus a short timeout, and one slow feature can no longer hold every worker. That is the cheapest fix when the risk is slowness.
A crash loop is different
From the same starting point, every recommendations call now crashed its process 50 ms in, with an assumed 2 second restart, so the process looped: up about 62.5 ms, down 2,000 ms, or about 3% uptime. In the one app, 98.7% of checkouts failed and orders fell to 0.5 per second. In the split version, checkout was at 0.0% errors and 39.7 orders per second.
No worker pool helps here. Pools divide workers inside one process, and a crash ends the process with every worker and every queued request in it. Only separate processes contain crashes.
Shipping one feature cost 157 checkouts
Deploying a change to recommendations restarted the whole app in the monolith, an assumed 4 seconds, and 157 checkouts failed, 22.0% of those counted. In the split version only the recommendations service restarted, an assumed 1.5 seconds, and checkout lost none. Rolling deploys shrink this in both designs, but every monolith deploy still replaces the process running all features, so every release carries the risk of every feature.
What the split costs on a normal day
Checkout median latency was 20.14 ms in one app against 22.72 ms split, a 2.58 ms gap, with p95 at 29.75 ms against 32.34 ms. That matches the assumed hop in the simulation. The real costs sit outside the request path: three pipelines and version contracts, per service dashboards and on call, and debugging a chain of calls that needs distributed tracing to follow.
Our take
Split when features fail independently and teams need to ship apart. Before that, try bulkheads and timeouts in the monolith: they contain slow calls at no network cost. And if you do split, never call the next service synchronously with a default timeout, or the failure just crosses the network instead. Every call needs a short timeout, a circuit breaker and a fallback.
Read the full article with the lab, the worked example and the failure modes: https://systemdesignsimple.com/monolith-vs-microservices/
Top comments (0)