Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 2.18 KB

File metadata and controls

67 lines (40 loc) · 2.18 KB

📌 429 vs 503 HTTP Status Codes

Both indicate that the server cannot process the request right now, but the reasons differ.


1️⃣ 429 Too Many Requests

Definition:

Indicates that the client has sent too many requests in a given timeframe.

Key Points:

  • Related to rate limiting.
  • The server is healthy, but the client is overloading it.
  • Response may include Retry-After header to tell client when to retry.

Example Scenario:

  • API allows 100 requests per minute.
  • Client sends 120 requests in a minute → server responds 429 Too Many Requests.

2️⃣ 503 Service Unavailable

Definition:

Indicates that the server is temporarily unable to handle the request, usually due to overload or maintenance.

Key Points:

  • Related to server-side issues, not the client.
  • Server may be down for maintenance, or overloaded.
  • Response may include Retry-After header to indicate when service will be available.

Example Scenario:

  • Web server is overloaded with traffic or undergoing maintenance → responds 503 Service Unavailable.

3️⃣ Comparison Table

Feature 429 Too Many Requests 503 Service Unavailable
Cause Client sends too many requests Server temporarily unavailable
Responsibility Client-side (rate limiting) Server-side (overload/maintenance)
Retry Retry after specified time (Retry-After) Retry after server recovers
Example API request limit exceeded Server down for maintenance

4️⃣ Analogy

  • 429: Like a restaurant telling a frequent customer, “You’ve ordered too many dishes too fast, wait a bit before ordering more.”
  • 503: Like a restaurant telling everyone, “We are closed for cleaning or too crowded, come back later.”

💡 Key takeaway:

  • 429 → Client is sending too much.
  • 503 → Server is temporarily unavailable.