Serverless: build and ship event-driven apps on AWS
An introduction to the Serverless series: Lambda, API Gateway, DynamoDB, EventBridge, SQS and SNS, Step Functions, AppSync, and the event-driven patterns that tie them together in production.
“Serverless” doesn’t mean there are no servers. It means they’re not your problem. You don’t provision capacity, patch operating systems or pay for idle machines. You write the business logic, wire managed services together, and pay for what you use.
That last point changes how you design. When I built Trivolt, a multiplayer quiz game, the whole stack (API, database, real-time updates and AI question generation) costs close to nothing when nobody is playing, and scales up on its own when a room full of people joins at once.
Two of my open-source projects come up throughout the series as real-world examples:
- Trivolt: real-time multiplayer play with API Gateway, Lambda, DynamoDB and AppSync Events.
- The Better Store: an ecommerce system built with domain-driven design and microservice patterns, including sagas, idempotent consumers and database per service.
The series
Compute and APIs
- Lambda: functions as the unit of compute: invocation models, cold starts, concurrency, and what a function is (and isn’t) good for.
- API Gateway: the front door: REST vs HTTP vs WebSocket APIs, authorisers, and when a Lambda function URL is enough.
Data
- DynamoDB: a database designed around access patterns: keys, indexes, single-table design, and capacity modes.
Events and messaging
- EventBridge: the event router: buses, rules, Pipes and Scheduler.
- SQS and SNS: queues and fan-out: decoupling, buffering, retries and dead-letter queues.
Orchestration
- Step Functions: workflows as state machines: Standard vs Express, direct service integrations, and error handling.
Real-time and GraphQL
- AppSync GraphQL: one API for many data sources: schemas, resolvers and subscriptions.
- AppSync Events: serverless WebSockets: channels, handlers and real-time fan-out without managing connections.
Putting it together
- Event-driven patterns you can ship to production: fan-out, load levelling, orchestration vs choreography, idempotency, the outbox pattern, anti-corruption layers, and observability.
Building services vs drawing their boundaries
This series is about how to build serverless services. It doesn’t try to answer the harder question that comes first: where should one service end and the next begin? That’s the job of domain-driven design. If you’re splitting a system into services, read The Better Store, Part 2 on finding bounded contexts and Part 3 on structuring the code inside each one.
Before you start
This series assumes you’re comfortable with IAM roles and policies; every serverless service relies on them. If you haven’t already, work through Core Foundations first.
You’ll also want a way to deploy infrastructure as code. The examples use AWS SAM, a CloudFormation extension with shorthand for serverless resources:
sam init # scaffold a project from a template
sam build # package your functions
sam deploy --guided
Everything here works the same in the AWS CDK or Terraform if you prefer them.
The serverless mindset
A few ideas run through every post:
- Use managed services for the undifferentiated parts. Routing, retries, queues, fan-out and workflows are already built. Write code for the logic that’s unique to you.
- Design for events, not calls. Services react to things that happened rather than waiting on each other, which makes systems easier to scale and change.
- Assume at-least-once delivery. Most event sources can deliver the same message twice, so make handlers idempotent.
- Cost follows usage. Great for spiky and low-traffic workloads; at very high, steady volume, check the maths against containers.
Start with Lambda.
Want to go further? See the Serverless references for the official guides, patterns and tools behind this series.
← All topics