Course contentsShow
← System Design
Lesson 1499 of 1,91937. Real-World System: URL ShortenerFree lesson

Bandwidth Requirements for Redirects

Calculate ingress and egress bandwidth based on request rates and payload sizes.

Bandwidth Requirements for Redirects

You'll learn how to calculate the network bandwidth needed to handle URL shortener redirects based on expected traffic and data transfer sizes.

Understanding Bandwidth in URL Shorteners

Bandwidth measures the rate of data transfer in your system. For a URL shortener, you need to calculate two types:

Ingress (incoming): Data arriving when users request shortened URLs
Egress (outgoing): Data leaving when your system responds with redirects

Think of bandwidth like water flowing through pipes—you need pipes big enough to handle peak flow without bursting or causing bottlenecks.

Calculating Ingress Bandwidth

A typical redirect request looks like:

GET /abc123 HTTP/1.1
Host: short.ly
Headers: ~500 bytes

Formula:
Ingress bandwidth = Requests per second × Average request size

If you expect 10,000 redirects/second with 500-byte requests:
10,000 req/s × 500 bytes = 5 MB/s = 40 Mbps

Calculating Egress Bandwidth

A redirect response includes:

HTTP/1.1 302 Found
Location: https://original-long-url.com/path
Headers: ~800 bytes

Formula:
Egress bandwidth = Responses per second × Average response size

With 10,000 redirects/second and 800-byte responses:
10,000 req/s × 800 bytes = 8 MB/s = 64 Mbps

Real-World Considerations

  • Peak traffic multiplier: Add 2-3× buffer for traffic spikes
  • Protocol overhead: Account for TCP/IP headers (typically 5-10% extra)
  • Analytics payloads: If logging metadata, increase per-request size accordingly
  • CDN offloading: Popular links can be cached at edge, dramatically reducing origin bandwidth

Key Takeaway: Bandwidth requirements equal request rate times payload size for both ingress and egress; always plan for peak traffic with appropriate headroom to prevent bottlenecks during viral link spikes.