SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Reactive Microservices
with AWS Lambda
Lu Hong
Software Development Engineer
AWS Serverless Apps
S R V 2 0 1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is serverless?
https://aws.amazon.com/serverless/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
More than just AWS Lambda!
https://aws.amazon.com/serverless/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What are reactive microservices?
https://aws.amazon.com/serverless/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Example: Simple banking microservice
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Here are our tools for today
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless API
POST /accounts
GET /accounts/{accountId}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Traditional data access
accountId customerId type balance
1 A CHECKING $25.00
2 B SAVINGS $40.00
3 A SAVINGS $10.00
4 C CHECKING $35.00
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Traditional data access
accountId customerId type balance
1 A CHECKING $25.00
2 B SAVINGS $40.00
3 A SAVINGS $10.00
4 C CHECKING $35.00
Account account = getAccountById(1)
account.credit($25.00)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Traditional data access
accountId customerId type balance
1 A CHECKING $25.00
2 B SAVINGS $40.00
3 A SAVINGS $10.00
4 C CHECKING $35.00
accountId customerId type balance
1 A CHECKING $50.00
2 B SAVINGS $40.00
3 A SAVINGS $10.00
4 C CHECKING $35.00
Account account = getAccountById(1)
account.credit($25.00)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event sourcing
sequence event
1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00}
2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345}
3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321}
accountId: 1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event sourcing
sequence event
1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00}
2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345}
3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321}
4 DEBITED: {amount:$20.00, debitType:FEE, refId:6789}
accountId: 1
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CQRS
Traditional
Command
operations
Query
operations
Command
operations
Query
operations
CQRS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Write operations
Amazon DynamoDB Streams + Lambda
Event store
Query view
Non-primary key
query operations
Consumer
Lambda
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless CQRS
Event store
Query view
GetAccountsByCustomer
Consumer
Lambda
Write operations +
GetAccountById
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Single entity, many log entries
accountId sequence event
1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00}
1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345}
1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321}
1 4 DEBITED: {amount:$20.00, debitType:FEE, refId:6789}
… … …
1 536 CREDITED: {amount:$30.00, creditType:DEPOSIT, refId:5435}
1 537 DEBITED: {amount:$20.00, debitType:WITHDRAWAL, refId:1290}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Solution: Snapshots
accountId version snapshot
1 512 {customerId:A, type:CHECKING, balance:$220.00}
1 536 {customerId:A, type:CHECKING, balance:$135.00}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Solution: Snapshots
accountId sequence event
1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00}
1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345}
1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321}
1 4 DEBITED: {amount:$20.00, debitType:FEE, refId:6789}
… … …
1 536 CREDITED: {amount:$30.00, creditType:DEPOSIT, refId:5435}
1 537 DEBITED: {amount:$20.00, debitType:WITHDRAWAL, refId:1290}
accountId version snapshot
1 512 {customerId:A, type:CHECKING, balance:$220.00}
1 536 {customerId:A, type:CHECKING, balance:$135.00}
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event sourcing: Optimistic locking
accountId sequence event
1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00}
1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345}
1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321}
sequence: 4
event: DEBITED: {amount:$20.00,
debitType:FEE, refId:6789
sequence: 4
event: DEBITED: {amount:$40.00,
debitType:WITHDRAWAL, refId:141
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Event sourcing: Optimistic locking
accountId sequence event
1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00}
1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345}
1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321}
sequence: 4
event: DEBITED: {amount:$20.00,
debitType:FEE, refId:6789
sequence: 4
event: DEBITED: {amount:$40.00,
debitType:WITHDRAWAL, refId:141
OptimisticLockException
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Optimistic locking with DynamoDB
aws dynamodb put-item 
--table-name BankAccountEntityEvents
--condition-expression 
“attribute_not_exists(EntityId) AND
attribute_not_exists(SequenceNumber)”
...
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Launched in preview @ re:Invent 2017
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Generally available in February 2018
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consuming applications
Lambda
Console
AWS
SDK
Serverless
Application
RepositorySearch/deploy
SAM apps
Consumers
(AWS customers)
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consuming applications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consuming applications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consuming applications
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Publishing applications
Publisher
Console
AWS
SDK
Serverless
Application
Repository
Publish
SAM apps
Publishers
(AWS customers)
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lu Hong
Twitter: @luhong07
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Contenu connexe

Tendances

Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...
Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...
Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...Amazon 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
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Amazon Web Services
 
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018Amazon Web Services
 
Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018
Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018
Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018Amazon Web Services
 
Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...
Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...
Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...Amazon Web Services
 
SRV207 Orchestrating AWS Lambda with Step Functions
 SRV207 Orchestrating AWS Lambda with Step Functions SRV207 Orchestrating AWS Lambda with Step Functions
SRV207 Orchestrating AWS Lambda with Step FunctionsAmazon Web Services
 
Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...
Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...
Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...Amazon Web Services
 
Enhance customer experience with Conversational Interfaces
Enhance customer experience with Conversational InterfacesEnhance customer experience with Conversational Interfaces
Enhance customer experience with Conversational InterfacesAmazon Web Services
 
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...Amazon Web Services
 
Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...
Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...
Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...Amazon Web Services
 
Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018
Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018
Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018Amazon Web Services
 
Five New Security Automations Using AWS Security Services & Open Source (SEC4...
Five New Security Automations Using AWS Security Services & Open Source (SEC4...Five New Security Automations Using AWS Security Services & Open Source (SEC4...
Five New Security Automations Using AWS Security Services & Open Source (SEC4...Amazon Web Services
 
[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...
[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...
[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...Amazon Web Services
 
Multi-Account Strategy and Security with Centrica Hive
Multi-Account Strategy and Security with Centrica HiveMulti-Account Strategy and Security with Centrica Hive
Multi-Account Strategy and Security with Centrica HiveAmazon Web Services
 
IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...
IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...
IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...Amazon Web Services
 
Serverless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best PracticesServerless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best PracticesAmazon Web Services
 
Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...
Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...
Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...Amazon Web Services
 
Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018
Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018
Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018Amazon Web Services
 
How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...
How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...
How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...Amazon Web Services
 

Tendances (20)

Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...
Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...
Build a Searchable Media Library & Moderate Content at Scale Using Machine Le...
 
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
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
 
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
AWS and Symantec: Cyber Defense at Scale (SEC311-S) - AWS re:Invent 2018
 
Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018
Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018
Enterprise DevOps: Patterns of Efficiency (ENT311-R1) - AWS re:Invent 2018
 
Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...
Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...
Deep Dive on Amazon S3 Storage Classes: Creating Cost Efficiencies across You...
 
SRV207 Orchestrating AWS Lambda with Step Functions
 SRV207 Orchestrating AWS Lambda with Step Functions SRV207 Orchestrating AWS Lambda with Step Functions
SRV207 Orchestrating AWS Lambda with Step Functions
 
Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...
Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...
Continuous Compliance for Modern Application Pipelines (GPSWS402) - AWS re:In...
 
Enhance customer experience with Conversational Interfaces
Enhance customer experience with Conversational InterfacesEnhance customer experience with Conversational Interfaces
Enhance customer experience with Conversational Interfaces
 
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
CI/CD for Serverless and Containerized Applications (DEV309-R1) - AWS re:Inve...
 
Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...
Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...
Inside AWS: Technology Choices for Modern Applications (SRV305-R1) - AWS re:I...
 
Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018
Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018
Optimizing Costs as You Scale on AWS (ENT302) - AWS re:Invent 2018
 
Five New Security Automations Using AWS Security Services & Open Source (SEC4...
Five New Security Automations Using AWS Security Services & Open Source (SEC4...Five New Security Automations Using AWS Security Services & Open Source (SEC4...
Five New Security Automations Using AWS Security Services & Open Source (SEC4...
 
[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...
[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...
[NEW LAUNCH!] Introducing ML Insights with Amazon QuickSight (ANT379) - AWS r...
 
Multi-Account Strategy and Security with Centrica Hive
Multi-Account Strategy and Security with Centrica HiveMulti-Account Strategy and Security with Centrica Hive
Multi-Account Strategy and Security with Centrica Hive
 
IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...
IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...
IAM for Enterprises: How Vanguard Matured IAM Controls to Support Micro Accou...
 
Serverless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best PracticesServerless Architectural Patterns and Best Practices
Serverless Architectural Patterns and Best Practices
 
Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...
Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...
Deploying Your ONNX Deep Learning with Apache MXNet Model Server (AIM413) - A...
 
Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018
Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018
Leadership Session: AWS Security (SEC305-L) - AWS re:Invent 2018
 
How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...
How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...
How Rovio Uses Amazon CloudFront for Secure API Acceleration (CTD315) - AWS r...
 

Similaire à Reactive Microservices with AWS Lambda (SRV201-R1) - AWS re:Invent 2018

AppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAWS User Group Bengaluru
 
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...Amazon Web Services
 
Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...
Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...
Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...Codemotion
 
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Amazon Web Services
 
Amazon EventBridge: AWS re:Invent Serverless London Recap Day
Amazon EventBridge: AWS re:Invent Serverless London Recap DayAmazon EventBridge: AWS re:Invent Serverless London Recap Day
Amazon EventBridge: AWS re:Invent Serverless London Recap DayJulian Wood
 
AWS re:Invent serverless recap day: Amazon EventBridge
AWS re:Invent serverless recap day: Amazon EventBridgeAWS re:Invent serverless recap day: Amazon EventBridge
AWS re:Invent serverless recap day: Amazon EventBridge⛷️ Ben Smith
 
PayPal Real Time Analytics
PayPal  Real Time AnalyticsPayPal  Real Time Analytics
PayPal Real Time AnalyticsAnil Madan
 
Subscribed 2017: Building a Data Pipeline to Engage and Retain Your Subscribers
Subscribed 2017: Building a Data Pipeline to Engage and Retain Your SubscribersSubscribed 2017: Building a Data Pipeline to Engage and Retain Your Subscribers
Subscribed 2017: Building a Data Pipeline to Engage and Retain Your SubscribersZuora, Inc.
 
Building Modern Apps Using Amazon DynamoDB Transactions
Building Modern Apps Using Amazon DynamoDB TransactionsBuilding Modern Apps Using Amazon DynamoDB Transactions
Building Modern Apps Using Amazon DynamoDB TransactionsAmazon Web Services
 
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Amazon Web Services
 
BDA303 Amazon Rekognition: Deep Learning-Based Image and Video Analysis
BDA303 Amazon Rekognition: Deep Learning-Based Image and Video AnalysisBDA303 Amazon Rekognition: Deep Learning-Based Image and Video Analysis
BDA303 Amazon Rekognition: Deep Learning-Based Image and Video AnalysisAmazon Web Services
 
AWS 金融服務概覽與區塊鍊案例分享
AWS 金融服務概覽與區塊鍊案例分享AWS 金融服務概覽與區塊鍊案例分享
AWS 金融服務概覽與區塊鍊案例分享Amazon Web Services
 
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...Codemotion
 
Building Customer-Centric Contact Centers in Financial Services
Building Customer-Centric Contact Centers in Financial Services Building Customer-Centric Contact Centers in Financial Services
Building Customer-Centric Contact Centers in Financial Services Amazon Web Services
 
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMakerBDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMakerAmazon Web Services
 
Modernize Your Threat Detection and Remediation Process Using Cloud Services
Modernize Your Threat Detection and Remediation Process Using Cloud ServicesModernize Your Threat Detection and Remediation Process Using Cloud Services
Modernize Your Threat Detection and Remediation Process Using Cloud ServicesAmazon Web Services
 
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...Amazon Web Services
 
Invoicing Gem - Sales & Payments In Your App
Invoicing Gem - Sales & Payments In Your AppInvoicing Gem - Sales & Payments In Your App
Invoicing Gem - Sales & Payments In Your AppMartin Kleppmann
 

Similaire à Reactive Microservices with AWS Lambda (SRV201-R1) - AWS re:Invent 2018 (20)

AppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learnt
 
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
How Zocdoc Achieves Automatic Threat Detection & Remediation with Security as...
 
Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...
Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...
Amitay Horwitz - Building event sourced systems with Kafka Streams - Codemoti...
 
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
Optimize Your SaaS Offering with Serverless Microservices (GPSTEC405) - AWS r...
 
Amazon EventBridge: AWS re:Invent Serverless London Recap Day
Amazon EventBridge: AWS re:Invent Serverless London Recap DayAmazon EventBridge: AWS re:Invent Serverless London Recap Day
Amazon EventBridge: AWS re:Invent Serverless London Recap Day
 
AWS re:Invent serverless recap day: Amazon EventBridge
AWS re:Invent serverless recap day: Amazon EventBridgeAWS re:Invent serverless recap day: Amazon EventBridge
AWS re:Invent serverless recap day: Amazon EventBridge
 
PayPal Real Time Analytics
PayPal  Real Time AnalyticsPayPal  Real Time Analytics
PayPal Real Time Analytics
 
Subscribed 2017: Building a Data Pipeline to Engage and Retain Your Subscribers
Subscribed 2017: Building a Data Pipeline to Engage and Retain Your SubscribersSubscribed 2017: Building a Data Pipeline to Engage and Retain Your Subscribers
Subscribed 2017: Building a Data Pipeline to Engage and Retain Your Subscribers
 
You Dont Need a Server for That
You Dont Need a Server for ThatYou Dont Need a Server for That
You Dont Need a Server for That
 
Building Modern Apps Using Amazon DynamoDB Transactions
Building Modern Apps Using Amazon DynamoDB TransactionsBuilding Modern Apps Using Amazon DynamoDB Transactions
Building Modern Apps Using Amazon DynamoDB Transactions
 
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
Engage Users in Real-Time through Event-Based Messaging (MOB322-R1) - AWS re:...
 
E-Commerce serverless
E-Commerce serverlessE-Commerce serverless
E-Commerce serverless
 
BDA303 Amazon Rekognition: Deep Learning-Based Image and Video Analysis
BDA303 Amazon Rekognition: Deep Learning-Based Image and Video AnalysisBDA303 Amazon Rekognition: Deep Learning-Based Image and Video Analysis
BDA303 Amazon Rekognition: Deep Learning-Based Image and Video Analysis
 
AWS 金融服務概覽與區塊鍊案例分享
AWS 金融服務概覽與區塊鍊案例分享AWS 金融服務概覽與區塊鍊案例分享
AWS 金融服務概覽與區塊鍊案例分享
 
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
Boxcars and Cabooses: When one more XHR is too much - Peter Chittum - Codemot...
 
Building Customer-Centric Contact Centers in Financial Services
Building Customer-Centric Contact Centers in Financial Services Building Customer-Centric Contact Centers in Financial Services
Building Customer-Centric Contact Centers in Financial Services
 
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMakerBDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
BDA304 Build Deep Learning Applications with TensorFlow and Amazon SageMaker
 
Modernize Your Threat Detection and Remediation Process Using Cloud Services
Modernize Your Threat Detection and Remediation Process Using Cloud ServicesModernize Your Threat Detection and Remediation Process Using Cloud Services
Modernize Your Threat Detection and Remediation Process Using Cloud Services
 
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
AWS, I Choose You: Pokemon's Battle against the Bots (SEC402-R1) - AWS re:Inv...
 
Invoicing Gem - Sales & Payments In Your App
Invoicing Gem - Sales & Payments In Your AppInvoicing Gem - Sales & Payments In Your App
Invoicing Gem - Sales & Payments In Your App
 

Plus de 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
 

Plus de 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
 

Reactive Microservices with AWS Lambda (SRV201-R1) - AWS re:Invent 2018

  • 1.
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Reactive Microservices with AWS Lambda Lu Hong Software Development Engineer AWS Serverless Apps S R V 2 0 1
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is serverless? https://aws.amazon.com/serverless/
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. More than just AWS Lambda! https://aws.amazon.com/serverless/
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What are reactive microservices? https://aws.amazon.com/serverless/
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Example: Simple banking microservice
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Here are our tools for today
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless API POST /accounts GET /accounts/{accountId}
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Traditional data access accountId customerId type balance 1 A CHECKING $25.00 2 B SAVINGS $40.00 3 A SAVINGS $10.00 4 C CHECKING $35.00
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Traditional data access accountId customerId type balance 1 A CHECKING $25.00 2 B SAVINGS $40.00 3 A SAVINGS $10.00 4 C CHECKING $35.00 Account account = getAccountById(1) account.credit($25.00)
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Traditional data access accountId customerId type balance 1 A CHECKING $25.00 2 B SAVINGS $40.00 3 A SAVINGS $10.00 4 C CHECKING $35.00 accountId customerId type balance 1 A CHECKING $50.00 2 B SAVINGS $40.00 3 A SAVINGS $10.00 4 C CHECKING $35.00 Account account = getAccountById(1) account.credit($25.00)
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event sourcing sequence event 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00} 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345} 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321} accountId: 1
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event sourcing sequence event 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00} 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345} 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321} 4 DEBITED: {amount:$20.00, debitType:FEE, refId:6789} accountId: 1
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. CQRS Traditional Command operations Query operations Command operations Query operations CQRS
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Write operations Amazon DynamoDB Streams + Lambda Event store Query view Non-primary key query operations Consumer Lambda
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless CQRS Event store Query view GetAccountsByCustomer Consumer Lambda Write operations + GetAccountById
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Single entity, many log entries accountId sequence event 1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00} 1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345} 1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321} 1 4 DEBITED: {amount:$20.00, debitType:FEE, refId:6789} … … … 1 536 CREDITED: {amount:$30.00, creditType:DEPOSIT, refId:5435} 1 537 DEBITED: {amount:$20.00, debitType:WITHDRAWAL, refId:1290}
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Solution: Snapshots accountId version snapshot 1 512 {customerId:A, type:CHECKING, balance:$220.00} 1 536 {customerId:A, type:CHECKING, balance:$135.00}
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Solution: Snapshots accountId sequence event 1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00} 1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345} 1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321} 1 4 DEBITED: {amount:$20.00, debitType:FEE, refId:6789} … … … 1 536 CREDITED: {amount:$30.00, creditType:DEPOSIT, refId:5435} 1 537 DEBITED: {amount:$20.00, debitType:WITHDRAWAL, refId:1290} accountId version snapshot 1 512 {customerId:A, type:CHECKING, balance:$220.00} 1 536 {customerId:A, type:CHECKING, balance:$135.00}
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event sourcing: Optimistic locking accountId sequence event 1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00} 1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345} 1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321} sequence: 4 event: DEBITED: {amount:$20.00, debitType:FEE, refId:6789 sequence: 4 event: DEBITED: {amount:$40.00, debitType:WITHDRAWAL, refId:141
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Event sourcing: Optimistic locking accountId sequence event 1 1 CREATED: {customerId:A, type:CHECKING, initialBalance:$25.00} 1 2 CREDITED: {amount:$25.00, creditType:DEPOSIT, refId:12345} 1 3 DEBITED: {amount:$10.00, debitType:WITHDRAWAL, refId:54321} sequence: 4 event: DEBITED: {amount:$20.00, debitType:FEE, refId:6789 sequence: 4 event: DEBITED: {amount:$40.00, debitType:WITHDRAWAL, refId:141 OptimisticLockException
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Optimistic locking with DynamoDB aws dynamodb put-item --table-name BankAccountEntityEvents --condition-expression “attribute_not_exists(EntityId) AND attribute_not_exists(SequenceNumber)” ...
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Launched in preview @ re:Invent 2017
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Generally available in February 2018
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Consuming applications Lambda Console AWS SDK Serverless Application RepositorySearch/deploy SAM apps Consumers (AWS customers)
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Consuming applications
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Consuming applications
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Consuming applications
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Publishing applications Publisher Console AWS SDK Serverless Application Repository Publish SAM apps Publishers (AWS customers)
  • 37. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lu Hong Twitter: @luhong07
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.