Api Gateway hard
Your Gateway communicates with backends via HTTP/1.1 connections. A slow backend service causes 'Head-of-Line Blocking'. How does switching to HTTP/2 as the Gateway-to-Backend transport mitigate this?
- A HTTP/2 uses a faster compression algorithm (HPACK) that makes the server respond 10x quicker.
- B Through Multiplexing: HTTP/2 allows multiple concurrent request/response streams on a single TCP connection, so a slow request doesn't block the line for others.
- C HTTP/2 automatically mirrors all slow requests to a faster backup server.
- D It uses UDP instead of TCP, which doesn't require waiting for acknowledgments.
Answer: B. Through Multiplexing: HTTP/2 allows multiple concurrent request/response streams on a single TCP connection, so a slow request doesn't block the line for others.
In HTTP/1.1, a single TCP connection can only handle one request at a time. If the Gateway is waiting for a 10s response, that connection is useless for others. HTTP/2 'Interleaves' packets from different requests, allowing many conversations to happen over one socket simultaneously.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is the primary architectural role of an API Gateway in a microservices environment?
- Why is 'Stateless Token Validation' (e.g., using JWTs) significantly more scalable at the Gateway level than 'Stateful Validation' (e.g., using Opaque/Reference Tokens)?
- Your Gateway is configured to cache any URL ending in `.css` or `.jpg`. An attacker tricks a victim into visiting `https://api.com/v1/profile/info/style.css`. How can this lead to an 'Account Takeover'?
- An API is receiving a sudden surge of 10,000 requests per second from a single IP address. How does an API Gateway preserve the stability of the backend services?
- How can an API Gateway help prevent 'Double Charging' in a payment system when a mobile client retries a failed request due to a poor connection?
- What is the primary operational benefit of performing 'SSL Termination' at the API Gateway?