Background jobs and retries
Work that runs after the request, with retries.
My stack for this
- 01Amazon SQS
The queue. Set visibility timeout to six times the function timeout.
- 02AWS Lambda
Batched consumers with partial batch failures.
- 03Amazon EventBridge
Routing and schedules.
- 04Lambda durable functions
Watching, for multi-step jobs with flaky dependencies.
Don't
- AWS Step Functions
A JSON state machine for logic that a few lines of JavaScript express better, and one more thing to deploy and debug. SQS with retries covers simple async work; Lambda durable functions are the candidate for multi-step jobs.
Instead: Amazon SQS or Lambda durable functions
The picks, in brief
What each one is, my verdict, and what it costs. Every name opens the full entry: when to use it and when not, the gotchas with their fixes, provisioning and alternatives.
The queue in front of Lambda. Natural back-pressure, nearly free when batched.
Pricing: Sydney: $0.40 per million requests (Standard), $0.50 (FIFO). A request carries up to 10 messages, so batching cuts the bill tenfold: 50M messages ≈ $6 batched, $60 unbatched.
My default for event-driven work and heavy compute. Classic Lambda, zip-packaged, Node.js.
Pricing: $0.20 per million requests + $0.0000133334/GB-s on Arm ($0.0000166667 on x86). Free tier: 1M requests and 400,000 GB-s a month, always.
The event bus and scheduler I use all the time.
Pricing: Classic bus: AWS management events are ingested free; custom events $1 per million (billed in 64 KB chunks). Scheduler: 14 million invocations a month free, then $1.20 per million in Sydney. Pipes: $0.40 per million requests. The new Custom Event Bus (September 2026) bills by data instead: in Sydney $0.19 per GB ingested (first 5 TB) and $0.058 per GB delivered to each subscriber.
Per-step retries in plain code, inside Lambda. A candidate fix for hand-tuned SQS retry pain.
Pricing: Example: 1M runs a month of receive → enrich via a flaky API → write Postgres → notify ≈ $47, vs ~$10 for SQS + one Lambda (where a failure reruns every step) and ~$110 for Step Functions Standard. Sydney rates: $8.70 per million durable operations (each start, completed step, wait and step retry), $0.28 per GB written, $0.17 per GB-month retained, plus normal Lambda requests and compute, replays included.
Where they sit
The layers of the stack this job touches, with every tool named on this page.
Compute
Where business logic runs.
Want this stack in your AWS account?
Cloudless Labs is a Sydney consultancy. We migrate on-premises systems to AWS, build serverless apps on this stack, and coach teams to ship with Claude Code and Codex.