Hacker News new | ask | show | jobs
by danpalmer 1498 days ago
Yeah 200ms to the database feels essentially useless for a webapp. I'd normally expect <5ms for a typical app, and <1ms is ideal – that usually means the same rack or very close.

This time all adds up. For a moderately complex webapp something like 10-20 queries isn't unheard of (even when you're careful about N+1 queries and caching). If each of those is taking ~5-10ms, add the network latency, and you're at ~50-150ms, which is pretty much your time budget for most end-user-facing webapps.

This is one of the problems with compute at the edge, you have to be much smarter about these things because there are a lot more network roundtrips between your app and database than there are between your customer and your app. Edge replicas help but still complicate things.