AlgoViz

AWS Lambda

medium 25 min

AWS Lambda runs your function when an event arrives and stops charging when it ends.

Remember it

The few things worth knowing cold, and how to make them stick.

Memory hook

Ring the bell. The first helper needs an apron.

Helpers appear when a bell rings. The apron is the cold start, two rings at once need two helpers, dressing helpers early costs money, and a full house says try later.

Cheat sheet

Concurrency
rate x duration
Run time
30 min
Memory
128 to 10,240 MB
1 vCPU
1,769 MB
Regional limit
1,000 default
Growth
1,000 per 10 s per function
Async retries
2, up to 6 h if throttled
Package
250 MB, image 10 GB
SLA
99.95%

Spot it when you see

  • Uploads, messages, webhooks, schedules.
  • Spiky traffic with idle time.
  • Glue between AWS services.

Tricks that stick

  • One ring, one helper.
  • Reserved is a fence, provisioned is a warm seat.
  • Who called decides who retries.
  • More memory is more CPU.

Do not forget

  • A new database connection for every call.
  • Marking an event done before doing it.
  • Failing a whole batch for one message.
  • No failure destination.
  • User data in global variables.