Serverless technologies like AWS Lambda has drastically simplified the task of building reactive systems - drop a file into S3 and a Lambda function would be triggered to process it, push an event into a Kinesis stream and magically it'll be processed by a Lambda function in real-time, you can even use Lambda to automate the process of auditing and securing your AWS account by automatically reacting to rule violations to your security policy.
Join us in this talk to see some architectural design patterns that have emerged with AWS Lambda, and learn how to pick the right event source based on the tradeoffs you want. Amongst the many patterns we'll explore, here are a few to whet your appetite : pub-sub, cron, push-pull, saga and decoupled invocation.
23. idea production
choose language
+ framework
master language
+ framework
figure out
deployment
configure AMI
configure ELB
configure
autoscaling
capacity planning
over-provision for
launch
are we doing
microservices?
configure CI/CD
24. idea production
choose language
+ framework
master language
+ framework
figure out
deployment
configure AMI
configure ELB
configure
autoscaling
capacity planning
over-provision for
launch
are we doing
microservices?
configure CI/CD
60. auto-update CloudWatch retention policy
auto-create alarms for new APIs
auto-create dashboards for new APIs
alert on suspicious console logins
alert on EC2 activities in unused regions
…
72. validate
what is Cognito?
Cognito
Federated Identities
Cognito
User Pools
Facebook TwitterGoogle
…
identity providers
API Gateway S3 DynamoDB SNSIOT Kinesis
authenticate token
token
IAM credential
IAM credential
146. charged based on no. of requests
($0.02 per 100,000 read request units)
147.
148. 1 msg/s for a month, 1KB per msg
$0.47
1 x 60s x 60m x 24hr x 30days
@ $0.014 per mil
+
24hrs x 30days
@ $0.015 per hr
$10.836
1 x 60s x 60m x 24hr x 30days
@ $0.5 per mil
$1.296
DynamoDB StreamsSNSKinesis Streams
1 Write Capacity Unit
@ $0.47 per unit
149. 1k msg/s for a month, 1KB per msg
1k x 60s x 60m x 24hr x 30days
@ $0.014 per mil
+
24hrs x 30days
@ $0.015 per hr
$47.088
1k x 60s x 60m x 24hr x 30days
@ $0.5 per mil
$1296.00
DynamoDB StreamsSNSKinesis Streams
$470.00
1k Write Capacity Unit
@ $0.47 per unit
164. 1 msg/s for a month, 1KB per msg
1 x 60s x 60m x 24hr x 30days
@ $0.4 per mil
$1.0368
1 x 60s x 60m x 24hr x 30days
@ $0.014 per mil
+
24hrs x 30days
@ $0.015 per hr
$10.836
1 x 60s x 60m x 24hr x 30days
@ $0.5 per mil
$1.296
SQSSNSKinesis
165. 1k msg/s for a month, 1KB per msg
1k x 60s x 60m x 24hr x 30days
@ $0.014 per mil
+
24hrs x 30days
@ $0.015 per hr
$47.088
1k x 60s x 60m x 24hr x 30days
@ $0.4 per mil
$1036.80
1k x 60s x 60m x 24hr x 30days
@ $0.5 per mil
$1296.00
SQSSNSKinesis
169. one function, many
concurrent invocations
job id task no. result
xxx 001 xxx
xxx 002 xxx
xxx 003 xxx
xxx 004 xxx
… … …
job results
each invocation
saves its own result
SNS DynamoDB
001
002
003
004
170. one function, many
concurrent invocations
max item size is 400KB
SNS
job id task no. result
xxx 001 xxx
xxx 002 xxx
xxx 003 xxx
xxx 004 xxx
… … …
job results
each invocation
saves its own result
DynamoDB
001
002
003
004
171. one function, many
concurrent invocations
invocations save results
in the same folder
SNS S3
001
002
003
004
max object size is 5TB!!
173. one function, many
concurrent invocations
job id tasks left
xxx 42
yyy 81
… …
job status
atomic decrement
no. of tasks left
the parent function
initialises no. of tasks left
SNS DynamoDB
001
002
003
004
174. job id tasks left
xxx 42
yyy 0
… …
job status
SNS DynamoDB
one function, many
concurrent invocations
all results are in
001
002
003
004
181. Begin transaction
Start book hotel request
End book hotel request
Start book flight request
End book flight request
Start book car rental request
End book car rental request
End transaction