Direct calls vs backend for frontend

With direct calls, each phone calls four services and gets four responses over the cell link. A backend for frontend joins them into one smaller response. With 1,000 phones on a 120 Mbps cell, direct calls fill the link: 90 percent of requests fail. One backend for frontend gives p99 79 ms.

Play the level

A page waits for its slowest callDrag or use arrow keys to change the calls per page

Calls per page: 20 · 18% of pages wait 2.0 s

Images through one cardArrow keys change the images per second. Tap to swap the card.

100 images/s · 1,600 of 1,000 Mbps · it does not fit

Case 1

1,000 phones share a 120 Mbps cell and refresh once a second. Each screen needs 20 KB from each of four services. p99 must stay below 140 ms. The budget is 46 USD/mo.

Case 1
Measure Goal Each phone calls 4 services One backend for frontend
p99 latency under 140 ms 10.1 s Fail 79 ms Pass
Error rate under 0.1% 89.6% Fail 0% Pass
Monthly cost 32 USD/mo 40 USD/mo
HTTP/2HTTP/2HTTP/2HTTP/2Live browse…Node API2 vCPU · 2 GBNode API2 vCPU · 2 GBNode API2 vCPU · 2 GBNode API2 vCPU · 2 GB
HTTP/2HTTP/2HTTP/2HTTP/2Live browse…Node APINode APINode APINode API
Each phone calls 4 services: misses a goal
HTTP/2HTTP/2HTTP/2HTTP/2HTTP/2Live browse…App backend2 vCPU · 1 GBNode API2 vCPU · 2 GBNode API2 vCPU · 2 GBNode API2 vCPU · 2 GBNode API2 vCPU · 2 GB
HTTP/2HTTP/2HTTP/2HTTP/2HTTP/2Live browse…App backendNode APINode APINode APINode API
One backend for frontend: meets the goals