Problems / Cloud and cost, medium
Two Lambda functions share an account: the customer API (about 100 ms a call) and a report export (about 4.5 s a call). Exports run 240 a second at month end. Neither has reserved concurrency, and the account limit is 1,000.
Unlock it once for 15 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.
Keep the API’s success at 99.9% or more. Exports may wait.
Like a coding problem, a solution has to pass every case, not just the one it was built for. Submit in the lab runs all 4; 1 of them are hidden until then.
400 requests a second for 120 seconds: 40% api (reads), 60% export (reads).
What each component does in this design, and what calls it. The simulator mimics each one from these settings.
| Component | Its job here | Settings |
|---|---|---|
| API Gateway (HTTP API)API gateway | Traffic enters here.Calls Customer API (Lambda), Report export (Lambda).Gateways centralise auth, rate limits and routing so each service does not reimplement them. | 100000 slots · 600,000 calls/min |
| Customer API (Lambda)Serverless function | API Gateway (HTTP API) forwards to it for /api.Calls DynamoDB.Serverless functions scale per request, but a cold start adds latency to the first call. | 1000 slots |
| Report export (Lambda)Serverless function | API Gateway (HTTP API) forwards to it for /export.Calls DynamoDB.Serverless functions scale per request, but a cold start adds latency to the first call. | 1000 slots |
| DynamoDBKey-value store | Customer API (Lambda) calls it. Report export (Lambda) calls it.Key-value stores spread keys over partitions; one very popular key can overload a single partition. | 40 partitions × 3,000 ops/s |