Latency is the time delay between a request being initiated and the corresponding response being received. In software development and networking, it is typically measured in milliseconds (ms) and represents how long a user or system must wait for an operation to complete. Low latency is critical for delivering responsive user experiences, and even small increases in delay can noticeably impact user satisfaction, conversion rates, and application performance.
Latency manifests at multiple layers of a technology stack. Network latency measures the time for data packets to travel between two points, influenced by physical distance, routing, and network congestion. Server latency reflects how long the backend takes to process a request, including database queries, API calls, and business logic execution. Client-side latency encompasses rendering time, JavaScript execution, and local processing. End-to-end latency (often called round-trip time or RTT) captures the total delay a user experiences.
Reducing latency is a core focus of performance engineering, and strategies include:
- Caching: Store frequently accessed data in memory (using Redis, Memcached, or CDNs) to avoid repeated computation or network calls.
- Content Delivery Networks (CDNs): Serve static assets from geographically distributed edge servers close to users.
- Database optimization: Use indexing, query optimization, and read replicas to reduce data retrieval time.
- Asynchronous processing: Offload time-consuming tasks to background workers to keep request-response cycles fast.
- Edge computing: Process data closer to the source rather than in a centralized data center.
For software applications, latency directly affects user engagement and business outcomes. Research shows that even a 100ms increase in page load time can reduce conversion rates. Optimizing for latency across every layer of the stack helps ensure applications deliver the fast, smooth experiences users expect.