AWS Serverless Architectural Patterns and Best Practices
AWS Serverless Architectural Patterns and Best Practices
Sascha Möllering
29.03.2017
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
Amazon
RDS Amazon API Amazon
AWS IoT
Gateway CloudWatch
Serverless patterns built with functions
Amazon Amazon
CloudFront S3
Browser
Amazon Amazon
CloudFront S3
• OAI • Bucket Policies
• Geo-Restriction • ACLs
• Signed Cookies
• Signed URLs
• DDOS
Browser
Amazon API
Gateway AWS Amazon
AuthZ Lambda DynamoDB
• Throttling
• Caching
• Usage Plans
IAM IAM
Serverless web app security
Amazon Amazon
CloudFront S3
• OAI • Bucket Policies
• Geo-Restriction • ACLs
• Signed Cookies
• Signed URLs
• DDOS
Browser
Streams
logs logs
Amazon API AWS Amazon
AWS WAF Gateway Lambda DynamoDB
• WebACL Testing • Latency • Latency
• Invocations
• Total Requests • Count • Invocation Errors • Throughput
• Allowed/Blocked • Cache Hit/Miss • Throttled Reqs
• Duration
Requests by ACL • 4XX/5XX Errors • Returned Bytes
• Throttled
Invocations • Documentation
Serverless web app lifecycle management
AWS
Lambda
Code/Packages/
Swagger
Amazon
DynamoDB
package deploy
CI/CD Tools
Amazon API Gateway best practices
Your Node.js
/{proxy+} ANY Express app
AWS Lambda:
Mappers
…. Amazon DynamoDB:
Mapper Results
Considerations and best practices
KPL: S3:
Producer Amazon Kinesis: Lambda: Intermediate Aggregated S3:
Stream Stream Processor Data Final Aggregated Output
Sensors
Sensors
Sensors
50,000
MESSAGES/SEC
10,000 10,000
1 2 3 4 5 6
HOURS
Cost comparison
Amazon
S3 …. Amazon DynamoDB:
Mapper Results
Batch Layer
KPL: S3:
Data Producer Amazon Kinesis: Lambda: Intermediate Aggregated S3:
Stream Stream Processor Data Final Aggregated Output
Sources
Sensors Serving Layer
Amazon DynamoDB:
EC2 Instance Properties
Automation: image thumbnail creation from S3
Triggered on
PUTs
Users upload photos
CapitalOne Cloud Custodian
Amazon CloudWatch Events: AWS Lambda: Amazon SNS:
Rules Triggered Policy & Compliance Rules Alert Notifications
AWS CloudTrail:
Events