AWS Architecture
Serverless and cloud-native architecture patterns for airline systems.
Scope
Compute
- AWS Lambda for business logic
- Step Functions for orchestration
- ECS/Fargate for containers (if needed)
API Layer
- API Gateway (REST and HTTP)
- AppSync (GraphQL)
- CloudFront (CDN)
Data
- Prisma Postgres (managed PostgreSQL)
- Prisma Accelerate (edge caching)
- Redis (optional, sessions)
- S3 (object storage)
Integration
- EventBridge (events)
- SQS (queuing)
- SNS (notifications)
- Kinesis (streaming)
Research Topics
Architecture Considerations
Lambda Configuration
| Function Type | Memory | Timeout | Concurrency |
|---|
| API handlers | 512MB | 10s | On-demand |
| Flight search | 512MB | 5s | On-demand |
| Booking | 1024MB | 15s | Reserved: 100 |
| Payment | 1536MB | 30s | Provisioned: 50 |
Cold Start Mitigation
Strategies:
├── Provisioned Concurrency (for critical paths)
├── Lambda SnapStart (Java)
├── Keep-warm pattern (scheduled ping)
├── Smaller deployment packages
└── Lazy initialization
Step Functions Booking Saga
{
"StartAt": "ReserveSeat",
"States": {
"ReserveSeat": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:ReserveSeat",
"Catch": [{
"ErrorEquals": ["States.ALL"],
"Next": "CancelReservation"
}],
"Next": "ProcessPayment"
},
"ProcessPayment": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:ProcessPayment",
"Catch": [{
"ErrorEquals": ["States.ALL"],
"Next": "RefundAndCancel"
}],
"Next": "IssueTicket"
},
"IssueTicket": {
"Type": "Task",
"Resource": "arn:aws:lambda:...:IssueTicket",
"End": true
},
"RefundAndCancel": {
"Type": "Parallel",
"Branches": [
{"StartAt": "RefundPayment", ...},
{"StartAt": "CancelReservation", ...}
],
"End": true
}
}
}
EventBridge Patterns
Event Sources → EventBridge → Event Rules → Targets
Example Events:
├── booking.created
├── booking.cancelled
├── flight.delayed
├── inventory.updated
└── payment.processed
Integration Points
| AWS Service | Purpose |
|---|
| CloudWatch | Logging, metrics, alarms |
| X-Ray | Distributed tracing |
| Secrets Manager | Credentials |
| Parameter Store | Configuration |
| IAM | Access control |
| KMS | Encryption keys |
| WAF | Web security |
Cost Optimization
Strategies
- Right-size Lambda memory
- Use Savings Plans for baseline
- Reserved capacity for predictable workloads
- Spot instances for batch processing
- S3 lifecycle policies
- Prisma Postgres usage monitoring
Cost Breakdown (Target: $200-350/month)
Lambda: ~$50-100
├── Requests: First 1M free, then $0.20/1M
└── Duration: Based on GB-seconds
API Gateway: ~$50-100
├── REST API: $3.50/million
└── HTTP API: $1.00/million (prefer this)
Prisma Postgres (Pro): $49/month
├── 10M operations included
├── +$0.02/10K additional operations
└── 50 GB storage included
S3/Other: ~$50-100
├── Storage per GB
└── Requests
Security
Network
- VPC for database
- VPC endpoints for AWS services
- Security groups
- No public IPs for compute
Data
- Encryption at rest (KMS)
- Encryption in transit (TLS 1.3)
- Field-level encryption (sensitive data)
Access
- IAM roles (least privilege)
- Resource-based policies
- Cognito for user authentication
Monitoring
CloudWatch
Key Metrics:
├── Lambda: Duration, Errors, Throttles, ConcurrentExecutions
├── API Gateway: 4XX, 5XX, Latency, Count
├── Prisma: Query duration, cache hit rate (via Prisma Console)
└── Step Functions: ExecutionsFailed, ExecutionTime
Alarms
| Metric | Threshold | Action |
|---|
| Lambda errors | >1% | PagerDuty |
| API 5XX | >0.5% | Slack |
| Query latency | >500ms | Alert |
| Payment latency | >5s | Alert |
Reference Implementation
- AWS Serverless Airline Booking:
aws-samples/aws-serverless-airline-booking
- Step Functions Saga:
aws-samples/aws-step-functions-saga-pattern-with-sam