What is the difference between reserved and provisioned concurrency in Lambda?
Reserved concurrency sets aside part of your account's concurrency for one function and also caps it. Provisioned concurrency keeps a number of environments pre-initialised so invocations avoid cold starts, and it is billed for the time it is kept ready.
Explain it simply
Think of IRCTC Tatkal counters. Reserved concurrency is saying counters 1 to 5 are for this one service only, and it can never use more than five. Provisioned concurrency is keeping those five clerks already seated with systems logged in, so no one waits for a login.
Example
Account concurrency pool: 1000
Function A reserved = 200
-> A always can use up to 200, never more than 200
-> other functions share the remaining 800
Function B provisioned = 50
-> 50 environments stay initialised
-> first 50 parallel requests: no cold start
-> extra requests still run, but may cold startUse reserved to protect a critical function from being starved by others, or to limit a function so it cannot overwhelm a downstream database. Setting it to zero effectively switches the function off.
Use provisioned when response time matters, such as an API behind a customer-facing app. It can be scheduled with Application Auto Scaling for known busy hours. Reserved concurrency is free; provisioned concurrency has a charge.
What to say in the interview
"Reserved concurrency guarantees and caps a function's share of the account pool. Provisioned concurrency keeps warm environments ready to remove cold starts, at an extra cost. I use reserved to protect a database from a burst and provisioned for latency-critical APIs."
Common mistakes
- Thinking reserved concurrency removes cold starts. It does not.