Free course · 25 lessons · Intermediate

Node.js Serverless on AWS Lambda

Build and run production Node.js and TypeScript services on AWS Lambda through real production problems: async handlers and cold starts, bundling, secrets, API Gateway and function URLs, JWT auth, payload limits, idempotent APIs, SQS and EventBridge, DynamoDB Streams, Step Functions, RDS Proxy, concurrency and cost, observability with Powertools, safe deployments, security and testing, with runnable Node.js simulations in every lesson.

Start the course

1. Lambda Fundamentals for Node.js

How a Node.js function really runs on AWS Lambda: the handler contract, execution environments and cold starts, packaging, and configuration.

  1. Async Handlers and Unfinished Work — Why a handler that 'works locally' silently drops writes on Lambda, and how to make every piece of work finish before the response.
  2. Cold Starts and Init Code — Where code runs on Lambda (init versus handler), why clients belong outside the handler, and how to keep cold starts short.
  3. Bundling, ESM and Layers — Why a 60 MB deployment package slows every cold start, and how to bundle a Node.js function properly.
  4. Configuration and Secrets — Why fetching a secret on every invocation throttles your function, and how to load configuration safely and cheaply.

2. HTTP APIs on Lambda

Building APIs with API Gateway and function URLs: event formats, errors, authentication, limits and idempotency.

  1. API Gateway, HTTP APIs and Function URLs — Choosing the front door for a Lambda API, and the event-format mismatch that makes handlers read undefined.
  2. Errors, Status Codes and Logs — Why unhandled errors turn into vague 502s for clients, and how to return useful errors while keeping details in logs.
  3. Authentication: JWT Authorizers and Claims — Why decoding a JWT without verifying it is an open door, and how to authenticate Lambda APIs properly.
  4. Payload, Timeout and Streaming Limits — Why a report export works for small customers and fails with 413s and timeouts for big ones, and how to design around Lambda's limits.
  5. Idempotent APIs with Powertools — Why client retries create duplicate orders on Lambda, and how to make write endpoints idempotent.

3. Event-Driven Lambda

Queues, events and streams: the retry, ordering and duplicate-delivery behaviour you must design for.

  1. SQS: Partial Batch Failures and Visibility Timeouts — Why one bad message makes nine good ones run again and again, and how to configure SQS with Lambda correctly.
  2. EventBridge: Patterns, Retries and Archives — Why some events silently never reach their target, and how to make EventBridge delivery observable and recoverable.
  3. DynamoDB Streams: Ordering and Poison Records — Why one bad record can stop a stream consumer for a day, and how to process streams safely.
  4. Orchestration with Step Functions — Why chaining Lambdas that call each other ends in timeouts, double charges and lost state, and how Step Functions fixes it.
  5. S3 Events, Duplicates and Recursive Loops — How an image thumbnailer can invoke itself millions of times, and how to handle S3 events safely.

4. Data, Concurrency and Cost

Talking to databases from Lambda, controlling concurrency, and tuning memory for speed and cost.

  1. DynamoDB from Lambda: Pagination and Conditional Writes — Why a 'list all orders' endpoint silently returns a fraction of the data, and how to use the SDK v3 correctly.
  2. Relational Databases and RDS Proxy — How a traffic spike turns hundreds of Lambda instances into a database connection storm, and how to prevent it.
  3. Concurrency, Throttling and Noisy Neighbours — How a batch job starved a checkout API of concurrency, and how to budget concurrency across functions.
  4. Memory, CPU and Cost Tuning — Why the cheapest memory setting is often the most expensive, and how to find the right size for a function.

5. Running Node.js Serverless in Production

Observability, safe deployments, security, testing, and knowing when Lambda is the wrong platform.

  1. Observability: Structured Logs, Metrics and Traces — Why nobody could answer 'which customer is failing?' during an incident, and how to instrument Lambda properly.
  2. Safe Deployments: Versions, Aliases and Canaries — Why a one-line change took down checkout for everyone at once, and how to roll out Lambda changes gradually.
  3. Least Privilege and Lambda Security — How a vulnerable dependency in one function could delete every table in the account, and how to scope permissions.
  4. Testing Lambda Functions — Why a test suite that only runs in the cloud slows every change, and how to structure Node.js functions for fast, reliable tests.
  5. Lambda, Cloudflare Workers, Vercel or Cloud Run? — When Lambda is the wrong tool: matching workload shape to platform for Node.js services.

6. Capstone Case Studies

Design and defend complete serverless solutions with production constraints.

  1. Capstone: A Black-Friday Order Pipeline — Design an order pipeline on Lambda that survives 20x traffic without losing, duplicating or overselling orders.
  2. Capstone: Move an Express API to Lambda, or Decide Not To — Evaluate migrating an existing Express.js API to Lambda and produce a migration plan or a reasoned 'no'.