SlideShare a Scribd company logo
1 of 50
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
如何活用事件驅動架構快速擴展應用
Kim Kao (高翊凱)
Solutions Architect
Amazon Web Services
T r a c k 4 | S e s s i o n 1
Agenda
From APIs to events
Event-driven choreography with Amazon EventBridge
Customer case study
Orchestration with AWS Step Functions
Tracing and observability
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Small pieces loosely joined
Cloud-native architectures are
small pieces, loosely joined
APIs are the front door
of microservices
APIs are hardened contracts
API
API
Manage APIs with Amazon API Gateway
Lambda
function
Lambda
function
VPC
Amazon CloudWatch
monitoring
Amazon
CloudFront
Mobile
apps
Endpoints on
Amazon EC2
Endpoints
in your PCAPI
Gateway cache
Websites
Regional API endpoints
Internet
Services
Any other
AWS service
All publicly
accessible
endpoints
HTTP APIs
Up to 70% lower cost
50% lower latency
Standard authentication
API Gateway
Serverless application
… comprised of
decoupled services
that scale independently
and trigger execution
using events
How do Serverless applications work?
API Gateway
Storage
Databases
Analytics
. . .
Your
unique
business
logic
API call
User uploads a picture
Customer data updated
Anomaly detected
. . .
Fully-managed
services
Events
Functions
Concise function logic
• Use functions to transform, not transport
• Use purposefully built services for communication fan-out, message handling, data
replication, and writing to data stores/databases
• Leave retry and error handling to the services themselves
• Read only what you need, for example:
• Message filters in Amazon SNS
• Fine-grained rules in Amazon EventBridge
• Query filters in Amazon RDS & Amazon Aurora
• Use Amazon S3 Select
• Properly indexed databases
• Leverage Synchronous Vs Asynchronous invocations
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is an “event” ?
“something that
happens”
Events tell us a fact
Immutable time-series
Time What
2019 06 21 08 07 06 CustomerCreated
2019 06 21 08 07 09 OrderCreated
2019 06 21 08 07 13 PaymentSuccessful
2019 06 21 08 07 17 CustomerUpdated
. . . . . .
Commands Vs Events
Command
Has an intent
Directed to a target
Personal communication
”CreateAccount”
“AddProduct”
Event
It’s a fact
For others to observe
Broadcast one to many
”AccountCreated”
“ProductAdded”
Introducing AWS Lambda Event Destinations
For asynchronous invocations, capture
success or failure
• Record contains details about the request
and response in JSON format
• Contains more information than data sent
to a DLQ
• Can send both outcomes to the same
destination
or
• Can send success to one destination,
failure to another
AWS Lambda
AWS Lambda
Amazon EventBridge
Amazon SNS
Amazon SQS
NEW!!!
AWS Lambda – Destinations for Async Invocations
Amazon S3
Amazon SNS
Amazon SES
Amazon
EventBridge
Amazon
CloudWatch Logs
AWS Config
Amazon
CloudFormation
AWS CodeCommit
AWS Lambda
Amazon SNS
Amazon SQS
Amazon
EventBridge
Lambda
Function
onSuccess
onFailure
Event-driven architectures
Client
Mobile
IoT
Amazon
Kinesis
Amazon
DynamoDB
Events AWS Step
Functions
Amazon
SQS
Amazon
SNS
Messaging
AWS Step
Functions
AWS Step
Functions
AWS Lambda AWS Lambda
Amazon SNS
Connecting AWS event sources
Queues Pub/Sub Event Bus
Amazon
EventBridge
Amazon SQS
Messaging
Amazon EventBridge
Event source
SaaS event
bus
Custom event
bus
Default event
bus
Rules
AWS Lambda
Amazon Kinesis
AWS Step Functions
Additional targets
Amazon EventBridge
Event source
SaaS event
bus
Custom event
bus
Default event
bus
Rules
AWS Lambda
Amazon Kinesis
AWS Step Functions
Additional targets
"detail-type":
"source": "aws.partner/example.com/123",
"detail":
"ticketId":
"department":
"creator":
Amazon EventBridge
Event source
SaaS event
bus
Custom event
bus
Default event
bus
Rules
AWS Lambda
Amazon Kinesis
AWS Step Functions
Additional targets
"detail-type":
"source": "aws.partner/example.com/123",
"detail":
"ticketId":
"department":
"creator":
"source":
Amazon EventBridge
Event source
SaaS event
bus
Custom event
bus
Default event
bus
Rules
AWS Lambda
Amazon Kinesis
AWS Step Functions
Additional targets
"detail-type":
"source": "aws.partner/example.com/123",
"detail":
"ticketId": "
"department": "billing"
"creator":
"detail":
"department": ["billing", "fulfillment"]
Amazon EventBridge
Event source
SaaS event
bus
Custom event
bus
Default event
bus
Rules
AWS Lambda
Amazon Kinesis
AWS Step Functions
Additional targets
"detail-type": "Ticket Created"
"source": "aws.partner/example.com/123",
"detail":
"ticketId":
"department": "billing",
"creator":
"detail-type": ["Ticket Resolved"]
Common use cases
Targets
AWS Lambda
Amazon Kinesis
Data Firehose
Amazon SNS
Expanding event sources
SaaS integrations
Amazon
EventBridge
Custom event bus
SaaS event bus
Default event bus
Developing with events
Amazon EventBridge
Presentation
Logic
Data
App server
AWS Step
Functions
Amazon
SQS
Amazon
SNS Messaging
AWS Step
Functions
AWS Step
Functions
AWS Lambda AWS Lambda
Custom event bus
SaaS event bus
Default event bus
Schema registry and discovery
Explicitly publish and discover
Integrations for JetBrains and VS Code
Language bindings for Java, Python,
and TypeScript
Source of truth for sharing schema
Amazon
EventBridge
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
July 10, 2019
shop.LEGO.com
was switched to
serverless
on AWS
July 11, 2019
The day after,
Amazon EventBridge
was launched
Checkout event processing
Login
CheckoutPayment
Order
Data
sync
Shipping
Hub-and-spoke event bus
Login
Checkout
Payment
Order
Data
sync
Shipping
Pattern
Customer
login
Login Shipping
Send order
to SAP
Data sync
Customer, VIP,
wishlist sync
Checkout
Submit
order
Payment
Authorize
payment
Commerce
platform
Order
Process
order
Order and
customer
updates
Event
relay
Customer
login
Invoke
every
minute
Events Order
complete
Customer
login
Payment
authorized
Order
submit
Order
complete
EventBridge
FIFO
queue
Pattern – Hub-and-spoke event bus
{
"version": "0",
"id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718",
"detail-type": "State change Notification",
"source": "service-order-submit-dev",
"account": "111122223333",
"time": "2019-08-29T12:10:21Z",
"region": "eu-central-1",
"resources": [
"arn:aws:events:event-bus/checkout-bus"
],
"detail": {
}
}
Customer-specific
data goes in the
“detail”
Pattern – Hub-and-spoke event bus
{
"version": "0",
"id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718",
"detail-type": "State change Notification",
"source": "service-order-submit-dev",
"account": "123456789012",
"time": "2019-08-29T12:10:21Z",
"region": "eu-central-1",
"resources": ["arn:aws:events:event-bus/checkout-bus"],
"detail": {
"event": {
"meta_data": {
"site_id": "LEGO Shop",
"type": "CHECKOUT",
"subtype": "ORDER",
"status": "COMPLETE"
},
"data": {
"order_number": "T123456789",
"customer_id": "bf3703467718-29T12-6a7e8feb"
}
}
}
}
Standard syntax
across multiple
services
Custom for each
service
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Coordinate function execution
Track status
of data and
execution
Remove
redundant code
Business workflow is rarely sequential start to finish
Multiple decision paths
Need to handle failure
Multiple-step processes
AWS Step Functions + Lambda
“Serverless” workflow management with
zero administration:
• Makes it easy to coordinate the
components of distributed applications and
microservices using visual workflows
• Automatically triggers and tracks each step
and retries when there are errors, so your
application executes in order and as
expected
• Logs the state of each step, so when things
do go wrong, you can quickly diagnose and
debug problems
Choice
Start
ExtractImageMetadata
CheckJobStatus
Amazon
Rekognition
ImageTypeCheck
NotSupportedImageType
End
Thumbnail
AddRekognizedTags
Tasks
Failure capture
Parallel tasks
AWS Step Functions: Integrations
Simplify building workloads, such as order processing,
report generation, and data analysis
Write and maintain less code; add services in minutes
More service integrations:
AWS Step
Functions
Amazon SNS Amazon SQS Amazon
SageMaker
AWS Glue AWS Batch Amazon ECS AWS Fargate Amazon EMR
NEW!!!
Simpler integration, less code
With serverless polling With direct service integrationStart
End
Lambda
functions
Start
End
No
Lambda
functions
Express workflows
High volume, short duration
Cost effective at scale
Streaming data processing –
IoT ingestion
Event streams over 100,000 per second
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS X-Ray
Profile and troubleshoot
distributed applications:
• Lambda instruments incoming
requests for all supported
languages and can capture
calls made in code
• Amazon API Gateway
inserts a tracing header
into HTTP calls and reports
data back to X-Ray
var AWSXRay = require(‘aws-xray-sdk-core‘);
var AWS = AWSXRay.captureAWS(require(‘aws-sdk’));
S3Client = AWS.S3();
CloudWatch ServiceLens – a single interface
for traces, metrics, logs, and alarms
CloudWatch Embedded Metric Format – custom metrics
from ephemeral resources (functions, containers)
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Finding successLambdausage
IT automation Data transformation Business critical application
Production
mission critical
Adoption curve
Considerations
Rapid development
Time-to-market – agility
Changing business
More tooling available
Thank you!
© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Kim Kao
@Yikaikao

More Related Content

What's hot

Track 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptx
Track 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptxTrack 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptx
Track 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptxAmazon Web Services
 
Track 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptx
Track 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptxTrack 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptx
Track 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptxAmazon Web Services
 
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotCostruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotAmazon Web Services
 
Big Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSBig Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSAmazon Web Services
 
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Amazon Web Services
 
Track 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptx
Track 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptxTrack 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptx
Track 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptxAmazon Web Services
 
Track 6 Session 2_ 搭建現代化的資料數據湖.pptx
Track 6 Session 2_ 搭建現代化的資料數據湖.pptxTrack 6 Session 2_ 搭建現代化的資料數據湖.pptx
Track 6 Session 2_ 搭建現代化的資料數據湖.pptxAmazon Web Services
 
Track 1 Session 1_企業善用雲端來加速數位化及創新
Track 1 Session 1_企業善用雲端來加速數位化及創新Track 1 Session 1_企業善用雲端來加速數位化及創新
Track 1 Session 1_企業善用雲端來加速數位化及創新Amazon Web Services
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWSChristian Beedgen
 
Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境Amazon Web Services
 
Webinar: Make Your Cloud Strategy Work for 2016
Webinar: Make Your Cloud Strategy Work for 2016Webinar: Make Your Cloud Strategy Work for 2016
Webinar: Make Your Cloud Strategy Work for 2016Alexandra Sasha Tchulkova
 
AWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la Nube
AWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la NubeAWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la Nube
AWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la NubeAmazon Web Services LATAM
 
Track 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptx
Track 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptxTrack 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptx
Track 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptxAmazon Web Services
 
AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)
AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)
AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)Amazon Web Services LATAM
 
Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用
Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用
Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用Amazon Web Services
 
Big Data & Analytics - Innovating at the Speed of Light
Big Data & Analytics - Innovating at the Speed of LightBig Data & Analytics - Innovating at the Speed of Light
Big Data & Analytics - Innovating at the Speed of LightAmazon Web Services LATAM
 
Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用
Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用
Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用Amazon Web Services
 
Keynote Roberto Delamora - AWS Cloud Experience Argentina
Keynote Roberto Delamora - AWS Cloud Experience ArgentinaKeynote Roberto Delamora - AWS Cloud Experience Argentina
Keynote Roberto Delamora - AWS Cloud Experience ArgentinaAmazon Web Services LATAM
 
AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...
AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...
AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...Amazon Web Services LATAM
 

What's hot (20)

Track 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptx
Track 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptxTrack 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptx
Track 1 Session 6_建立安全高效的資料分析平台加速金融創新_HC+EMQ Cliff(已檢核,上下無黑邊).pptx
 
Track 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptx
Track 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptxTrack 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptx
Track 6 Session 1_進入 AI 領域的第一步驟_資料平台的建置.pptx
 
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker AutopilotCostruisci modelli di Machine Learning con Amazon SageMaker Autopilot
Costruisci modelli di Machine Learning con Amazon SageMaker Autopilot
 
Big Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWSBig Data Architectural Patterns and Best Practices on AWS
Big Data Architectural Patterns and Best Practices on AWS
 
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
Track 6 Session 6_ 透過 AWS AI 服務模擬、部署機器人於產業之應用
 
Track 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptx
Track 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptxTrack 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptx
Track 5 Session 3_ 迎戰DDoS攻擊的資安最佳實踐.pptx
 
Track 6 Session 2_ 搭建現代化的資料數據湖.pptx
Track 6 Session 2_ 搭建現代化的資料數據湖.pptxTrack 6 Session 2_ 搭建現代化的資料數據湖.pptx
Track 6 Session 2_ 搭建現代化的資料數據湖.pptx
 
Track 1 Session 1_企業善用雲端來加速數位化及創新
Track 1 Session 1_企業善用雲端來加速數位化及創新Track 1 Session 1_企業善用雲端來加速數位化及創新
Track 1 Session 1_企業善用雲端來加速數位化及創新
 
5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS5 Years Of Building SaaS On AWS
5 Years Of Building SaaS On AWS
 
Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境Track 1 Session 3_建構安全高效的電子設計自動化環境
Track 1 Session 3_建構安全高效的電子設計自動化環境
 
Webinar: Make Your Cloud Strategy Work for 2016
Webinar: Make Your Cloud Strategy Work for 2016Webinar: Make Your Cloud Strategy Work for 2016
Webinar: Make Your Cloud Strategy Work for 2016
 
AWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la Nube
AWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la NubeAWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la Nube
AWS Cloud Experience CA: Mejores prácticas para su Transformación hacia la Nube
 
Track 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptx
Track 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptxTrack 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptx
Track 6 Session 3_如何藉由 AWS AI 和機器學習平台搭建多功能的 AI 解決方案.pptx
 
AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)
AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)
AWS Cloud Experience CA: Cómo reducir sus costos en AWS (broad cost strategy)
 
Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用
Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用
Track 2 Session 5_ 利用 SageMaker 深度學習容器化在廣告推播之應用
 
Big Data & Analytics - Innovating at the Speed of Light
Big Data & Analytics - Innovating at the Speed of LightBig Data & Analytics - Innovating at the Speed of Light
Big Data & Analytics - Innovating at the Speed of Light
 
Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用
Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用
Track 4 Session 5_ 架構即代碼 – AWS CDK 與 CDK8S 聯手打造下一代的 K8S 應用
 
Keynote Roberto Delamora - AWS Cloud Experience Argentina
Keynote Roberto Delamora - AWS Cloud Experience ArgentinaKeynote Roberto Delamora - AWS Cloud Experience Argentina
Keynote Roberto Delamora - AWS Cloud Experience Argentina
 
Enterprise Cloud Adoption
Enterprise Cloud AdoptionEnterprise Cloud Adoption
Enterprise Cloud Adoption
 
AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...
AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...
AWS Cloud Experience CA: Bases de Datos en AWS: distintas necesidades, distin...
 

Similar to Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用

Getting started building your first serverless web application on AWS
Getting started building  your first serverless web application on AWSGetting started building  your first serverless web application on AWS
Getting started building your first serverless web application on AWSIoannis Polyzos
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about serversAmazon Web Services
 
How LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessHow LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessSheenBrisals
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesRohini Gaonkar
 
So You Think You're an AWS Master aka Serverless Computing
So You Think You're an AWS Master aka Serverless ComputingSo You Think You're an AWS Master aka Serverless Computing
So You Think You're an AWS Master aka Serverless ComputingAmazon Web Services
 
How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018Amazon Web Services
 
Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...
Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...
Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...Amazon Web Services
 
What's new in Serverless at AWS?
What's new in Serverless at AWS?What's new in Serverless at AWS?
What's new in Serverless at AWS?Daniel Zivkovic
 
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Amazon Web Services
 
Deep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftDeep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftAmazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
AWS March 2016 Webinar Series   Getting Started with Serverless ArchitecturesAWS March 2016 Webinar Series   Getting Started with Serverless Architectures
AWS March 2016 Webinar Series Getting Started with Serverless ArchitecturesAmazon Web Services
 
Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018
Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018
Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018Amazon Web Services
 
Voxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by DesignVoxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by DesignVoxxed Athens
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAmazon Web Services
 
AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...
AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...
AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...⛷️ Ben Smith
 
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS InfrastructureUsing AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS InfrastructureAmazon Web Services
 
Serverless Generative AI on AWS, AWS User Groups of Florida
Serverless Generative AI on AWS, AWS User Groups of FloridaServerless Generative AI on AWS, AWS User Groups of Florida
Serverless Generative AI on AWS, AWS User Groups of FloridaCloudHesive
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentAmazon Web Services
 

Similar to Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用 (20)

Getting started building your first serverless web application on AWS
Getting started building  your first serverless web application on AWSGetting started building  your first serverless web application on AWS
Getting started building your first serverless web application on AWS
 
Build and run applications without thinking about servers
Build and run applications without thinking about serversBuild and run applications without thinking about servers
Build and run applications without thinking about servers
 
How LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With ServerlessHow LEGO.com Accelerates With Serverless
How LEGO.com Accelerates With Serverless
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
So You Think You're an AWS Master aka Serverless Computing
So You Think You're an AWS Master aka Serverless ComputingSo You Think You're an AWS Master aka Serverless Computing
So You Think You're an AWS Master aka Serverless Computing
 
How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018How to build and deploy serverless apps - AWS Summit Cape Town 2018
How to build and deploy serverless apps - AWS Summit Cape Town 2018
 
Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...
Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...
Security & Governance on AWS – Better, Faster, and Cost Effective - Technical...
 
What's new in Serverless at AWS?
What's new in Serverless at AWS?What's new in Serverless at AWS?
What's new in Serverless at AWS?
 
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
Getting Started with Serverless Architectures - August 2016 Monthly Webinar S...
 
Stream Processing in 2019
Stream Processing in 2019Stream Processing in 2019
Stream Processing in 2019
 
Deep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY LoftDeep Dive on Serverless Application Development NY Loft
Deep Dive on Serverless Application Development NY Loft
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
AWS March 2016 Webinar Series   Getting Started with Serverless ArchitecturesAWS March 2016 Webinar Series   Getting Started with Serverless Architectures
AWS March 2016 Webinar Series Getting Started with Serverless Architectures
 
Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018
Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018
Using AWS Lambda as a Security Team (SEC322-R1) - AWS re:Invent 2018
 
Voxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by DesignVoxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by Design
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...
AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...
AWS re:Invent serverless recap day: Controls for-managing-events-in-serverles...
 
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS InfrastructureUsing AWS Lambda to Build Control Systems for Your AWS Infrastructure
Using AWS Lambda to Build Control Systems for Your AWS Infrastructure
 
Serverless Generative AI on AWS, AWS User Groups of Florida
Serverless Generative AI on AWS, AWS User Groups of FloridaServerless Generative AI on AWS, AWS User Groups of Florida
Serverless Generative AI on AWS, AWS User Groups of Florida
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Track 4 Session 1_MAD01 如何活用事件驅動架構快速擴展應用

  • 1. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. 如何活用事件驅動架構快速擴展應用 Kim Kao (高翊凱) Solutions Architect Amazon Web Services T r a c k 4 | S e s s i o n 1
  • 2. Agenda From APIs to events Event-driven choreography with Amazon EventBridge Customer case study Orchestration with AWS Step Functions Tracing and observability
  • 3. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 4. Small pieces loosely joined Cloud-native architectures are small pieces, loosely joined
  • 5. APIs are the front door of microservices
  • 6. APIs are hardened contracts API API
  • 7. Manage APIs with Amazon API Gateway Lambda function Lambda function VPC Amazon CloudWatch monitoring Amazon CloudFront Mobile apps Endpoints on Amazon EC2 Endpoints in your PCAPI Gateway cache Websites Regional API endpoints Internet Services Any other AWS service All publicly accessible endpoints
  • 8. HTTP APIs Up to 70% lower cost 50% lower latency Standard authentication API Gateway
  • 9. Serverless application … comprised of decoupled services that scale independently and trigger execution using events
  • 10. How do Serverless applications work? API Gateway Storage Databases Analytics . . . Your unique business logic API call User uploads a picture Customer data updated Anomaly detected . . . Fully-managed services Events Functions
  • 11. Concise function logic • Use functions to transform, not transport • Use purposefully built services for communication fan-out, message handling, data replication, and writing to data stores/databases • Leave retry and error handling to the services themselves • Read only what you need, for example: • Message filters in Amazon SNS • Fine-grained rules in Amazon EventBridge • Query filters in Amazon RDS & Amazon Aurora • Use Amazon S3 Select • Properly indexed databases • Leverage Synchronous Vs Asynchronous invocations
  • 12. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 13. What is an “event” ? “something that happens” Events tell us a fact Immutable time-series Time What 2019 06 21 08 07 06 CustomerCreated 2019 06 21 08 07 09 OrderCreated 2019 06 21 08 07 13 PaymentSuccessful 2019 06 21 08 07 17 CustomerUpdated . . . . . .
  • 14. Commands Vs Events Command Has an intent Directed to a target Personal communication ”CreateAccount” “AddProduct” Event It’s a fact For others to observe Broadcast one to many ”AccountCreated” “ProductAdded”
  • 15. Introducing AWS Lambda Event Destinations For asynchronous invocations, capture success or failure • Record contains details about the request and response in JSON format • Contains more information than data sent to a DLQ • Can send both outcomes to the same destination or • Can send success to one destination, failure to another AWS Lambda AWS Lambda Amazon EventBridge Amazon SNS Amazon SQS NEW!!!
  • 16. AWS Lambda – Destinations for Async Invocations Amazon S3 Amazon SNS Amazon SES Amazon EventBridge Amazon CloudWatch Logs AWS Config Amazon CloudFormation AWS CodeCommit AWS Lambda Amazon SNS Amazon SQS Amazon EventBridge Lambda Function onSuccess onFailure
  • 17. Event-driven architectures Client Mobile IoT Amazon Kinesis Amazon DynamoDB Events AWS Step Functions Amazon SQS Amazon SNS Messaging AWS Step Functions AWS Step Functions AWS Lambda AWS Lambda
  • 18. Amazon SNS Connecting AWS event sources Queues Pub/Sub Event Bus Amazon EventBridge Amazon SQS Messaging
  • 19. Amazon EventBridge Event source SaaS event bus Custom event bus Default event bus Rules AWS Lambda Amazon Kinesis AWS Step Functions Additional targets
  • 20. Amazon EventBridge Event source SaaS event bus Custom event bus Default event bus Rules AWS Lambda Amazon Kinesis AWS Step Functions Additional targets "detail-type": "source": "aws.partner/example.com/123", "detail": "ticketId": "department": "creator":
  • 21. Amazon EventBridge Event source SaaS event bus Custom event bus Default event bus Rules AWS Lambda Amazon Kinesis AWS Step Functions Additional targets "detail-type": "source": "aws.partner/example.com/123", "detail": "ticketId": "department": "creator": "source":
  • 22. Amazon EventBridge Event source SaaS event bus Custom event bus Default event bus Rules AWS Lambda Amazon Kinesis AWS Step Functions Additional targets "detail-type": "source": "aws.partner/example.com/123", "detail": "ticketId": " "department": "billing" "creator": "detail": "department": ["billing", "fulfillment"]
  • 23. Amazon EventBridge Event source SaaS event bus Custom event bus Default event bus Rules AWS Lambda Amazon Kinesis AWS Step Functions Additional targets "detail-type": "Ticket Created" "source": "aws.partner/example.com/123", "detail": "ticketId": "department": "billing", "creator": "detail-type": ["Ticket Resolved"]
  • 25. Targets AWS Lambda Amazon Kinesis Data Firehose Amazon SNS Expanding event sources SaaS integrations Amazon EventBridge Custom event bus SaaS event bus Default event bus
  • 26. Developing with events Amazon EventBridge Presentation Logic Data App server AWS Step Functions Amazon SQS Amazon SNS Messaging AWS Step Functions AWS Step Functions AWS Lambda AWS Lambda Custom event bus SaaS event bus Default event bus
  • 27. Schema registry and discovery Explicitly publish and discover Integrations for JetBrains and VS Code Language bindings for Java, Python, and TypeScript Source of truth for sharing schema Amazon EventBridge
  • 28. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 29. July 10, 2019 shop.LEGO.com was switched to serverless on AWS
  • 30. July 11, 2019 The day after, Amazon EventBridge was launched
  • 33. Pattern Customer login Login Shipping Send order to SAP Data sync Customer, VIP, wishlist sync Checkout Submit order Payment Authorize payment Commerce platform Order Process order Order and customer updates Event relay Customer login Invoke every minute Events Order complete Customer login Payment authorized Order submit Order complete EventBridge FIFO queue
  • 34. Pattern – Hub-and-spoke event bus { "version": "0", "id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718", "detail-type": "State change Notification", "source": "service-order-submit-dev", "account": "111122223333", "time": "2019-08-29T12:10:21Z", "region": "eu-central-1", "resources": [ "arn:aws:events:event-bus/checkout-bus" ], "detail": { } } Customer-specific data goes in the “detail”
  • 35. Pattern – Hub-and-spoke event bus { "version": "0", "id": "6a7e8feb-b491-4cf7-a9f1-bf3703467718", "detail-type": "State change Notification", "source": "service-order-submit-dev", "account": "123456789012", "time": "2019-08-29T12:10:21Z", "region": "eu-central-1", "resources": ["arn:aws:events:event-bus/checkout-bus"], "detail": { "event": { "meta_data": { "site_id": "LEGO Shop", "type": "CHECKOUT", "subtype": "ORDER", "status": "COMPLETE" }, "data": { "order_number": "T123456789", "customer_id": "bf3703467718-29T12-6a7e8feb" } } } } Standard syntax across multiple services Custom for each service
  • 36. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 37. Coordinate function execution Track status of data and execution Remove redundant code
  • 38. Business workflow is rarely sequential start to finish Multiple decision paths Need to handle failure Multiple-step processes
  • 39. AWS Step Functions + Lambda “Serverless” workflow management with zero administration: • Makes it easy to coordinate the components of distributed applications and microservices using visual workflows • Automatically triggers and tracks each step and retries when there are errors, so your application executes in order and as expected • Logs the state of each step, so when things do go wrong, you can quickly diagnose and debug problems Choice Start ExtractImageMetadata CheckJobStatus Amazon Rekognition ImageTypeCheck NotSupportedImageType End Thumbnail AddRekognizedTags Tasks Failure capture Parallel tasks
  • 40. AWS Step Functions: Integrations Simplify building workloads, such as order processing, report generation, and data analysis Write and maintain less code; add services in minutes More service integrations: AWS Step Functions Amazon SNS Amazon SQS Amazon SageMaker AWS Glue AWS Batch Amazon ECS AWS Fargate Amazon EMR NEW!!!
  • 41. Simpler integration, less code With serverless polling With direct service integrationStart End Lambda functions Start End No Lambda functions
  • 42. Express workflows High volume, short duration Cost effective at scale Streaming data processing – IoT ingestion Event streams over 100,000 per second
  • 43. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 44. AWS X-Ray Profile and troubleshoot distributed applications: • Lambda instruments incoming requests for all supported languages and can capture calls made in code • Amazon API Gateway inserts a tracing header into HTTP calls and reports data back to X-Ray var AWSXRay = require(‘aws-xray-sdk-core‘); var AWS = AWSXRay.captureAWS(require(‘aws-sdk’)); S3Client = AWS.S3();
  • 45. CloudWatch ServiceLens – a single interface for traces, metrics, logs, and alarms
  • 46. CloudWatch Embedded Metric Format – custom metrics from ephemeral resources (functions, containers)
  • 47. © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 48. Finding successLambdausage IT automation Data transformation Business critical application Production mission critical Adoption curve Considerations Rapid development Time-to-market – agility Changing business
  • 50. Thank you! © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kim Kao @Yikaikao

Editor's Notes

  1. The pattern that supports high speed innovation (agility, velocity, decision making) 3 core architecture patterns: APIs, Events, Data streams *** narrative to explain how this takes advantage of AWS platform resilience, and naturally scales with event volume *** 1/ One of my favorite descriptions of the Internet, that stuck with me from early on is – a collection of small pieces loosely joined (allowed it to grow so rapidly with such diversity) 2/ innovate – lots of experiments 3/ things loosely joined by APIs, Events and data flows are able to grow in different directions
  2. 1/ The first is API driven, request-reply services 2/ I often think of APIs as the front door of microservices
  3. Org design Innovate behind APIs - promises 1/ Inside of Amazon when we talk about 2-pizza teams, we often make a hardened API a requirement of any new team - using APIs to define the stable contract between teams. 2/ A service from team-A needs to call an API and get a valuable reply from the function built by team-B. APIs at the perimeter of Fargate services and Lambda functions, allow the teams to iterate actively without changing the request-reply structure between the teams.
  4. ** 2018 script ** 1/ we’ve built a lot of microservices, and we’ve seen a lot of patterns in the management of the APIs 2/ often starts with auth, and is well integrated with cognito and IAM 3/ resource control - throttling 4/ integrated with X-Ray and CloudWatch 5/ reachability options 6/ direct connect
  5. 1/ API Gateway has a released a significant improvement for serverless api calls, which is the best way to build RESTful APIs for serverless applications 2/ lowering your cost 70% and cutting latency times on API calls by 50% or better. 3/ This new feature has its own configuration interface, and will let you import existing APIs from the API Gateway Management tool, or any 3rd party API management system. 4/ Authentication using OIDC/OAUTH2 *** we can hopefully spend a little more time on this ***
  6. ** we launched Lambda at re:Invent 5 years ago, and have seen use cases and application patterns emerge over time as Lambda became more integrated with a wide range of serverless capabilities throughout AWS. 1/ Our terminology has evolved over that time, also. 2/ I tend to think of a Serverless Application as being comprised of decoupled services that scale independently and trigger execution using events. 3/ We think there at least 3 application patterns that work really well, and make up the majority of Serverless Applications -
  7. Real world (IoT); Old world (enterprise bus); Modern (mobile, decoupled) 1/ Events give you this great decoupling benefit 2/ individual services that react to each other
  8. SQS FIFO; SNS DLQ; Integration controls The first place to start is with the AWS event sources that already exist. We have our cloud native queueing and notification services… 1/ Any existing services that can post messages to publish messages to SNS, can start building NEW event-driven microservices built as functions in Lambda. 2/ AirBnB has created an opensource project for such a scenario. Having messages originate from containerized apps which result in an event triggering a Lambda is a very common use case. 3/ every time you use an AWS service, you can generate an event through EventBridge .
  9. But, earlier in the year we took another step with EventBridge by creating a 3rd party integration program. We actively work with some of the most common 3rd party software services running at AWS – services like: *** list partners ***. We think this program will continue to make it simpler for builders to subscribe to standard events 3rd parties they already use *** question whether we should single anyone out *** ** talk about the newest integration MongoDB?
  10. – For teams starting from a clean sheet, who are able to build without existing constraints, I enjoy talking about the benefits of event-driven architectures. But, for teams with an existing investment in a production system, how do they envision using events to build new additions using an event-driven design? But, sometimes a standard event doesn’t exist for the action you want to trap. So, we support custom events *** describe the previous process of building, documenting and publishing custom events ***
  11. We’re certainly doing everything we can to make it easier to create event sources, but what are we doing to add to the ability to consume the events and build more complex coordination between functions? Step Functions is a useful tool for consuming events, and defining coordinated execution of multiple services in response to those events – often, we’ll shorten that description to “workflow”. *** longer explanation of Step Functions ? *** So how do we track state between all these things? How do we make sure things are executing in the right order and at the right time? We need a state machine of course In simpler terms, we need a way to orchestrate the different workflows between all the services Set timeouts on tasks, interrupt execution, have tasks send heartbeats, and monitor and audit at fine granularity.
  12. So how do we track state between all these things? How do we make sure things are executing in the right order and at the right time? We need a state machine of course In simpler terms, we need a way to orchestrate the different workflows between all the services Set timeouts on tasks, interrupt execution, have tasks send heartbeats, and monitor and audit at fine granularity.
  13. Many applications contain workflows that must execute tasks in a reliable and repeatable sequence using independent components and services. Before Step Functions, customers who automated business processes had to spend weeks to write and then manage complex custom workflow code and interfaces. Today, customers use AWS Step Functions to add resilient workflow automation to their applications. Workflows on Step Functions require less code to write and maintain. Step Functions integrates with AWS Lambda. This makes it easy to add Lambda tasks to workflows, such as calculating a credit score as part of a loan application workflow, or creating a customer account as part of a subscription workflow. Customers asked us for more service integrations so that they could be even more productive with Step Functions. Now, developers can connect and coordinate eight more AWS compute, database and messaging services in minutes, without writing code. These new service integrations simplify and speed delivery of solutions for workloads such as order processing, report generation, and data analysis pipelines.
  14. To manage asynchronous jobs, customers can create serverless polling loops to detect when a job completes. With the new service integrations, when your workflows start an AWS Batch job, run a container on ECS or Fargate, or invoke a Lambda function, Step Functions will detect for you when the job, container, or function completes its work before transitioning to the next step.
  15. So, this was a packed hour, with a lot to think about. But, most of you are here because you are considering future plans, and validating ideas you have. Teams looking to adopt serverless programming models introduce the fundamentals from a couple of different perspectives