Understanding API Latency
Latency Budget
API latency is usually the sum of network, proxy, application, serialization, database, cache, and downstream dependency time.
Do not optimize blindly. Measure where time is spent.
A request taking 500 ms may consist of 20 ms application logic, 300 ms database queries, 100 ms external API calls, and 80 ms network/proxy overhead.
Profiling and tracing reveal the actual bottleneck.
Latency Components