- Resources & Library
- For Developers & Technical Teams
- Performance & Reliability
Network Latency Is Part of API Response Time
Queries are not the only factor; distance between users, application servers, and databases adds latency that must be measured.
Omar Alalwi Article
Database queries are an important source of response delay, but they are not the only one. Network latency adds time between the user and application server, and between the application and a database hosted separately.
If code and queries require 700 milliseconds, a distant network path may add hundreds more, while a nearby region may add only tens. These figures vary with routes and providers, so measure from the locations where users actually are.
Do not move servers before optimizing queries, addressing N+1 problems, enabling caching, and removing unnecessary loops or work. Once internal execution time is reduced, a closer region can become an architectural decision with a clear effect. Separate the measurements so you know whether the constraint is code, database, or network.
Share your perspective
I’d be glad to hear your perspective. Leave a comment on the original article on social media.