Recognising Reference Architectures for Web, Serverless and Batch
This lesson explains the reference architectures that most architecture questions vary, and why each component is there, so it is easier to see what a scenario is missing and which answer completes it.
Learning outcomes
After completing this lesson, you will be able to:
- Describe a highly available three-tier web application.
- Describe a serverless application.
- Describe a batch processing architecture.
A highly available three-tier web application
A highly available web application is built in tiers, and each tier removes a single point of failure. At the edge, Route 53 resolves the domain and can fail over between endpoints, CloudFront caches content close to users and absorbs traffic spikes, and AWS WAF filters attacks before they reach the application.
The web and application tier runs on EC2 instances in an Auto Scaling group spread across three Availability Zones, behind an Application Load Balancer. The load balancer sends traffic only to healthy instances, and the group replaces failed instances and adds capacity as demand grows. Because any instance may disappear, session state is kept in ElastiCache or DynamoDB rather than on the instances, so a user's next request can be served by any of them.
The data tier uses Aurora with replicas in other Availability Zones, or RDS Multi-AZ, so the database fails over automatically if its primary fails. Static content and uploads are stored in S3, which is durable and scales without limit, and are served through CloudFront. The following table summarises the tiers.
| Tier | Components | Purpose |
|---|---|---|
| Edge | Route 53, CloudFront, AWS WAF | DNS, caching near users, filtering attacks |
| Web and application | Application Load Balancer; EC2 Auto Scaling group across three AZs | Spread traffic; replace failed instances; scale with demand |
| Session state | ElastiCache or DynamoDB | Keep instances stateless |
| Data | Aurora with replicas in other AZs (or RDS Multi-AZ) | Durable, highly available relational data |
| Static content and uploads | Amazon S3 | Unlimited, durable object storage |
The following diagram shows the tiers described above.

Three-tier components
A serverless application
A serverless application is assembled entirely from managed services, so there are no servers to patch or scale. The static front end, such as a single-page application, is stored in S3 and delivered through CloudFront, or hosted with Amplify Hosting. Sign-in is handled by Amazon Cognito, which issues tokens that the API checks. The API is API Gateway invoking Lambda functions, and data is stored in DynamoDB, which scales with the traffic. Background work is passed through SQS or EventBridge to other Lambda functions, and multi-step processes are coordinated by Step Functions. The following table summarises the components.
| Need | Components |
|---|---|
| Static front end | S3 and CloudFront (or Amplify Hosting) |
| Sign-in | Amazon Cognito |
| API | API Gateway with Lambda |
| Data | DynamoDB |
| Background work | SQS or EventBridge with Lambda; Step Functions for workflows |
Every component scales automatically and costs nothing when idle, which suits variable traffic and small teams. Its limits (Lambda's 15 minutes, API Gateway's 29-second default integration timeout) push long work into asynchronous patterns.
The following diagram shows how the serverless components connect.

Serverless components
Batch and data processing
A batch processing architecture separates the arrival of work from its processing, so each part can scale and fail independently. When files arrive in S3, S3 event notifications or EventBridge start processing without any polling. An SQS queue buffers the jobs, so a burst of files does not overwhelm the workers and no job is lost if a worker fails.
The jobs run cheaply on AWS Batch, which manages job queues and launches capacity as needed, or on an Auto Scaling group of Spot Instances that scales with the queue depth; because the queue keeps each job until it is completed, an interrupted Spot Instance only delays the work. Results are stored in S3 and queried with Athena, or loaded into Redshift for heavy analysis. The following table summarises the components.
| Need | Components |
|---|---|
| Files arrive and trigger processing | S3 event notifications or EventBridge |
| Buffer and distribute jobs | SQS |
| Run jobs cheaply | AWS Batch or an Auto Scaling group on Spot Instances |
| Store results and query them | S3 with Athena, or Redshift for heavy analysis |
The following diagram shows the batch pipeline from arrival to results.

A batch pipeline
Completing a design
A company's web application runs on EC2 instances in an Auto Scaling group behind an ALB in two AZs. Users report being logged out when instances are replaced. What should the architect change?
Comparing with the reference architecture shows what is missing: session state is stored on the instances. Moving sessions to ElastiCache (or DynamoDB) makes the instances stateless, so Auto Scaling can replace them without affecting users. Sticky sessions would only reduce the problem, not solve it.
Where should session data be kept so that any web server can handle any request?
Show answer
Outside the servers, in a shared store such as ElastiCache or DynamoDB, so the web tier is stateless.
Exam Tips
Remember for the exam
- A highly available web tier is an ALB with an Auto Scaling group across multiple AZs.
- Keep instances stateless by storing sessions in ElastiCache or DynamoDB.
- Serverless designs combine S3, CloudFront, Cognito, API Gateway, Lambda and DynamoDB.
- Batch processing pairs SQS with Spot Instances or AWS Batch for low cost.
- Compare a scenario with the reference architecture to find the missing piece.