3 ms·
Assuming you can't get your database close to your users. It depends on the data dependencies between your database calls. If they're independent, and you do th
by toast0 6y ago
Assuming you can't get your database close to your users. It depends on the data dependencies between your database calls. If they're independent, and you do them in parallel, you can do pretty well with a frontend near your user, parallel queries to backends wherever.
If your queries have data dependencies, you'd get better results with a front end near your users, and a middle tier api near your database.
But, just TCP (or TLS) termination near your users and the real frontend near your database can make a surprising amount of difference.
On the other hand. There's a lot you can do to make sure things are fast from limited locations. Keep an eye on data size, make sure you're monitoring for and fixing slow queries, optimize your images, etc. If your html takes seconds to serve, it barely matters where you served it from.