SlideShare a Scribd company logo
1 of 32
©  2016,  Amazon  Web  Services,  Inc.  or  its  Affiliates.  All  rights  reserved.
Olivier  Klein  – Emerging  Technologies  Solutions  Architect,  Asia  Pacific
September  2016
Serverless Microservices
Build  Scalable,  Fault-­Tolerant  and  Transaction-­Safe  Microservices on  AWS
Microservices advocate  creating  a  system  
from  a  collection  of  small,  isolated  services,
each  of  which  owns  their  data,  
scalable  and  resilient  to  failure
How  to  Build  Application  Backends?
Back-­end  logic DatabaseBrowser  
/Mobile
How  to  Build  Serverless Microservices?
AWS  
Lambda
Amazon  API  
Gateway
Amazon  
DynamoDB
Microservice
How  to  Build  Serverless Microservices?
AWS  
Lambda
Amazon  API  
Gateway
Amazon  
DynamoDB
Microservice 1
Microservice 2
Microservice N
...
Amazon  API  Gateway
• Create,  publish,  maintain,  monitor  and  
secure  RESTful APIs
• Powered  by  our  content  delivery  
network  via  61  global  edge  locations
• Provides DDoS protection  and  
throttling capabilities
• Multiple  API  stages  which  you  define  
(e.g.  dev,  test,  prod)
AWS Lambda
Amazon API
Gateway
Amazon EC2
AWS API
On-­prem Server
Amazon  API  Gateway:  Authorisation
Amazon  API  
Gateway
• Allows  unauthenticated  requests,  or  
authorises via  AWS  IAM
• Amazon  Cognito or  AWS  STS  for  
temporary  credential  generation
• API  Keys  available  to  monitor  
individual  app  calls
• You  can  create  API  Key  specific  
throttling and  usage  plans
Basic  – 5  TPS
Premium  – 100  TPS
Power  – No  throttling
API  Keys  – Usage  Plans
Amazon  
Cognito
AWS  IAM
How  About  Deployments?
AWS  Lambda:  Versioning
• Immutable versions  of  functions
• Per  version  configuration
• Per  version  Cloudwatch metrics
• Cloudwatch Logs  contain  version  
attribute
• Aliases  to  “label”  a  version  release
• $LATEST  contains  latest  code
$LATEST(95) STABLE TESTING
94 X
93 X
92
Update  Alias  to  Deploy
$LATEST(95) STABLE TESTING
94 X X
93
92
Update  Alias  to  Deploy
API  Stages
API  Gateway  Stage  Variables
API  Gateway  Stage  Variables
API  Gateway Lambda Custom  Domain
/prod/Resources FunctionName:stable https://api.example.com
/dev/Resources FunctionName:$LATEST https://dev.example.com
/qa/Resources FunctionName:qa https://qa.example.com
Pin  your  Environment  with  Stage  Variables
Serverless Microservices
AWS  
Lambda
Amazon  API  
Gateway
• Highly  available
• Scalable
• Fault  tolerant
• Cost  effective
• Secure
• BUT:  Stateless!
Microservice
?
Challenge:  Centralised Database
user-­svc account-­svccart-­svc
DB
• Applications  often  have  a  
monolithic data  store
• Difficult  to  make  schema  
changes
• Technology  lock-­in
• Vertical  scaling
• Single  point  of  failure
Centralised Database  – Anti-­pattern
• Applications  often  have  a  
monolithic data  store
• Difficult  to  make  schema  
changes
• Technology  lock-­in
• Vertical  scaling
• Single  point  of  failure
user-­svc account-­svccart-­svc
DB
Decentralised Data  Stores
account-­svccart-­svc
DynamoDB RDS
user-­svc
ElastiCache RDS
• Polyglot persistence
• Each  service  chooses  it’s  
data  store  technology
• Low  impact  schema  changes
• Independent  scalability
• Data  is  gated  through  the  
service  API
CAP  Theorem
It  is  impossible  for  a  distributed  computer  system  to  
simultaneously  provide  all  3  of  the  following  guarantees:
• Consistency  
• Availability
• Partition  Tolerance
à In  the  presence  of    network  partition  we  need  to  choose  
between  consistency and  availability
Challenge:  Transactional  Integrity
• Polyglot  persistence  generally  translates  
into  eventual  consistency
• Asynchronous  calls  allow  non-­
blocking,  but  returns  need  to  be  handled  
properly
• How  about  transactional  integrity?
• Event-­sourcing  – Capture  changes  as  
sequence  of  events    
• Staged  commit
• Rollback  on  failure
ERROR
STATE?
ROLLBACK?
Let’s  try  a  Demo  – Online  Commerce
• Online  commerce  with  microservices to
• Checkout  a  cart
• Collect  payment
• Warehouse  Management
• Shipment
• High  volume  site,  out  of  stock  errors,  credit  
card  payments  with  risk  cut-­off  (<  100  USD)
• Demonstrate  successful and  failing  
transactions with  graceful  rollback
Best  Practice:  Use  Correlation  IDs
09-02-2015 15:03:24 ui-svc INFO [uuid-123] ……
09-02-2015 15:03:25 catalog-svc INFO [uuid-123] ……
09-02-2015 15:03:26 checkout-svc ERROR [uuid-123] ……
09-02-2015 15:03:27 payment-svc INFO [uuid-123] ……
09-02-2015 15:03:27 shipping-svc INFO [uuid-123] ……
ui-­svc
catalog-­
svc
checkout-­
svc
shipping-­
svc
payment-­
svc
request correlation  id:  
“uuid-­123”
correlation  id:  
“uuid-­123”
Best  Practice:  Microservice Owns  Rollback
• Every  microservice should  expose  
it’s  own  “rollback”  method
• This  method  could  just  rollback
changes,  or  trigger  subsequent  
actions (e.g.  send  notification)
• If  you  implement  staged  commit,  
also  expose  a  commit  function  
Microservice
Function  1
Rollback
Commit
(optional)
Event-­Driven:  DynamoDB Streams
• If  async,  consider  event-­driven  
approach  with  DynamoDB Streams
• Don’t  need  to  manage  function  
execution  failure,  DDB  Streams  
automatically  retries  until  successful
• “Attach”  yourself  to  the  data  of  
interest
• Kinesis,  SQS,  SNS  also  possible
Microservice
Challenge:  Report  Errors  /  Rollback
• What  if  functions  fail?  (business  logic  
failure,  not  code  failure)
• Create  a  “Transaction  Manager”  
microservice that  notifies  all  relevant  
microservices to  rollback  or  take  action
• DynamoDB is  the  trigger for  the  clean-­up
function  (could  be  SQS,  Kinesis  etc.)
• Use  Correlation  ID  to  identify  relations
mm-­svc
Transaction  
Manager  
Function
DDB  Streams
API  Call
Error  Table
Challenge:  Report  Errors  /  Rollback
ERROR
DynamoDB
Error  Table
Transaction  
Manager
Function
Kinesis
Error  Stream
SQS
Error  Queue
Rollback(co
rrelation-­id)
Rollback(co
rrelation-­id)
Rollback(co
rrelation-­id)
Rollback(co
rrelation-­id)
Challenge:  Code  Error
• Lambda  execution  error  because  of  
faulty  /  erroneous  code
• Leverage  Cloudwatch Logs  to  
process  error  message  and  call  
transaction  manager
• Set  Cloudwatch Logs  metric  filter  
to  look  for  error/exception  and  call  
Lambda  handler  upon  alarm  state
ui-­svc
Cloudwatch
Logs
Cloudwatch
Alarm
Transaction  
Manager  
Function
Beware:  Stream  Model  with  AWS  Lambda
• DynamoDB Streams  and  Kinesis  streams  directly  work  
with  AWS  Lambda,  however  AWS  Lambda  needs  to  
acknowledge  processing  the  message  correctly
• If  Lambda  fails  to  process  the  message,  the  stream  
horizon  will  not  be  moved  forward,  creating  a  “jam”
• Solution:  Monitor  AWS  Lambda  Error  Cloudwatch
Metric  and  react  when  error  rate  of  same  “Correlation  ID”  
keeps  increasing
MDM  – Keep  Data  Consistent
Databases
AWS  Lambda
“Cleanup”  
Function
Cloudwatch
Scheduled  Event
• Perform  Master  Data  Management  
(MDM)  to  keep  data  consistent
• Create  AWS  Lambda  function  to  
check  consistencies  across  
microservices and  “cleanup”
• Create  Cloudwatch Event
to  schedule  the  function  
(e.g.  hourly  basis)
Final  Thoughts
• Use  Amazon  API  Gateway  to  build  a  front-­door  to  all  your  
microservices (AWS  Lambda,  Docker,  EC2  etc.)
• Use  polyglot  persistence  to  avoid  bottlenecks,  schema  
issues  and  allow  independent  scalability  (and  cache)
• Embrace  eventual  consistency  and  design  fault-­tolerant  
business  processes  which  can  recover
• Monitor your  environment  and  cleanup whenever  
necessary  (automation  is  your  friend!)
Thank  You!

More Related Content

What's hot

An Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - WebinarAn Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - WebinarAmazon Web Services
 
Landing Zones - Creating a Foundation for Your AWS Migrations
Landing Zones - Creating a Foundation for Your AWS MigrationsLanding Zones - Creating a Foundation for Your AWS Migrations
Landing Zones - Creating a Foundation for Your AWS MigrationsAmazon Web Services
 
Serverless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about serversServerless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about serversAmazon Web Services
 
AWS Web Application Firewall and AWS Shield - Webinar
AWS Web Application Firewall and AWS Shield - Webinar AWS Web Application Firewall and AWS Shield - Webinar
AWS Web Application Firewall and AWS Shield - Webinar Amazon Web Services
 
Introduction to AWS IAM
Introduction to AWS IAMIntroduction to AWS IAM
Introduction to AWS IAMKnoldus Inc.
 
Content Delivery Using Amazon CloudFront - AWS Presentation - John Mancuso
Content Delivery Using Amazon CloudFront - AWS Presentation - John MancusoContent Delivery Using Amazon CloudFront - AWS Presentation - John Mancuso
Content Delivery Using Amazon CloudFront - AWS Presentation - John MancusoAmazon Web Services
 
Microsoft: Multi-tenant SaaS with Azure
Microsoft: Multi-tenant SaaS with AzureMicrosoft: Multi-tenant SaaS with Azure
Microsoft: Multi-tenant SaaS with AzureAIMDek Technologies
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatchAmazon Web Services
 
What is Cloud Computing with Amazon Web Services?
What is Cloud Computing with Amazon Web Services?What is Cloud Computing with Amazon Web Services?
What is Cloud Computing with Amazon Web Services?Amazon Web Services
 
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Amazon Web Services
 

What's hot (20)

An Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - WebinarAn Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - Webinar
 
Landing Zones - Creating a Foundation for Your AWS Migrations
Landing Zones - Creating a Foundation for Your AWS MigrationsLanding Zones - Creating a Foundation for Your AWS Migrations
Landing Zones - Creating a Foundation for Your AWS Migrations
 
Cloud Security (AWS)
Cloud Security (AWS)Cloud Security (AWS)
Cloud Security (AWS)
 
Aws config
Aws configAws config
Aws config
 
Deep Dive on AWS Lambda
Deep Dive on AWS LambdaDeep Dive on AWS Lambda
Deep Dive on AWS Lambda
 
Amazon ECS
Amazon ECSAmazon ECS
Amazon ECS
 
Serverless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about serversServerless Computing: build and run applications without thinking about servers
Serverless Computing: build and run applications without thinking about servers
 
AWS Web Application Firewall and AWS Shield - Webinar
AWS Web Application Firewall and AWS Shield - Webinar AWS Web Application Firewall and AWS Shield - Webinar
AWS Web Application Firewall and AWS Shield - Webinar
 
GuardDuty Hands-on Lab
GuardDuty Hands-on LabGuardDuty Hands-on Lab
GuardDuty Hands-on Lab
 
Fundamentals of AWS Security
Fundamentals of AWS SecurityFundamentals of AWS Security
Fundamentals of AWS Security
 
Serverless Architectures.pdf
Serverless Architectures.pdfServerless Architectures.pdf
Serverless Architectures.pdf
 
AWS Technical Essentials Day
AWS Technical Essentials DayAWS Technical Essentials Day
AWS Technical Essentials Day
 
Introduction to AWS IAM
Introduction to AWS IAMIntroduction to AWS IAM
Introduction to AWS IAM
 
Deep Dive into AWS SAM
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAM
 
Content Delivery Using Amazon CloudFront - AWS Presentation - John Mancuso
Content Delivery Using Amazon CloudFront - AWS Presentation - John MancusoContent Delivery Using Amazon CloudFront - AWS Presentation - John Mancuso
Content Delivery Using Amazon CloudFront - AWS Presentation - John Mancuso
 
Microsoft: Multi-tenant SaaS with Azure
Microsoft: Multi-tenant SaaS with AzureMicrosoft: Multi-tenant SaaS with Azure
Microsoft: Multi-tenant SaaS with Azure
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
What is Cloud Computing with Amazon Web Services?
What is Cloud Computing with Amazon Web Services?What is Cloud Computing with Amazon Web Services?
What is Cloud Computing with Amazon Web Services?
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
Webinar AWS 201 - Using Amazon Virtual Private Cloud (VPC)
 

Similar to Serverless Microservices

Serverless solutions - AWS Summit SG 2017
Serverless solutions - AWS Summit SG 2017 Serverless solutions - AWS Summit SG 2017
Serverless solutions - AWS Summit SG 2017 Amazon Web Services
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture PatternsAmazon Web Services
 
Being Well Architected in the Cloud
Being Well Architected in the CloudBeing Well Architected in the Cloud
Being Well Architected in the CloudAdrian Hornsby
 
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...Amazon Web Services
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
re:Invent recap session 2: Being well Architected in the cloud
re:Invent recap session 2: Being well Architected in the cloudre:Invent recap session 2: Being well Architected in the cloud
re:Invent recap session 2: Being well Architected in the cloudAmazon Web Services
 
Data Design and Modeling for Microservices I AWS Dev Day 2018
Data Design and Modeling for Microservices I AWS Dev Day 2018Data Design and Modeling for Microservices I AWS Dev Day 2018
Data Design and Modeling for Microservices I AWS Dev Day 2018AWS Germany
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudAmazon Web Services
 
Secure your AWS Account and your Organization's Accounts
Secure your AWS Account and your Organization's Accounts Secure your AWS Account and your Organization's Accounts
Secure your AWS Account and your Organization's Accounts Amazon Web Services
 
Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...
Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...
Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...Amazon Web Services
 
SMC301 The State of Serverless Computing
SMC301 The State of Serverless ComputingSMC301 The State of Serverless Computing
SMC301 The State of Serverless ComputingAmazon Web Services
 
2016-06 - Design your api management strategy - AWS - Microservices on AWS
2016-06 - Design your api management strategy - AWS - Microservices on AWS2016-06 - Design your api management strategy - AWS - Microservices on AWS
2016-06 - Design your api management strategy - AWS - Microservices on AWSSmartWave
 
AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)
AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)
AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)Amazon Web Services
 
AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...
AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...
AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...Amazon Web Services
 
Wild Rydes - Serverless DevOps to the Rescue
Wild Rydes - Serverless DevOps to the RescueWild Rydes - Serverless DevOps to the Rescue
Wild Rydes - Serverless DevOps to the RescueAmazon Web Services
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewaySteve Androulakis
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017ARDC
 
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornWorkshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornAmazon Web Services
 

Similar to Serverless Microservices (20)

Serverless solutions - AWS Summit SG 2017
Serverless solutions - AWS Summit SG 2017 Serverless solutions - AWS Summit SG 2017
Serverless solutions - AWS Summit SG 2017
 
(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns(ARC309) Getting to Microservices: Cloud Architecture Patterns
(ARC309) Getting to Microservices: Cloud Architecture Patterns
 
Being Well Architected in the Cloud
Being Well Architected in the CloudBeing Well Architected in the Cloud
Being Well Architected in the Cloud
 
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
Getting Started with AWS Lambda and the Serverless Cloud by Jim Tran, Princip...
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
re:Invent recap session 2: Being well Architected in the cloud
re:Invent recap session 2: Being well Architected in the cloudre:Invent recap session 2: Being well Architected in the cloud
re:Invent recap session 2: Being well Architected in the cloud
 
Data Design and Modeling for Microservices I AWS Dev Day 2018
Data Design and Modeling for Microservices I AWS Dev Day 2018Data Design and Modeling for Microservices I AWS Dev Day 2018
Data Design and Modeling for Microservices I AWS Dev Day 2018
 
ServerlessConf Tokyo キーノート
ServerlessConf Tokyo キーノートServerlessConf Tokyo キーノート
ServerlessConf Tokyo キーノート
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Secure your AWS Account and your Organization's Accounts
Secure your AWS Account and your Organization's Accounts Secure your AWS Account and your Organization's Accounts
Secure your AWS Account and your Organization's Accounts
 
Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...
Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...
Secure Your AWS Account and Your Organization's Accounts - SID202 - Chicago A...
 
Cloud Management with vRealize Operations
Cloud Management with vRealize OperationsCloud Management with vRealize Operations
Cloud Management with vRealize Operations
 
SMC301 The State of Serverless Computing
SMC301 The State of Serverless ComputingSMC301 The State of Serverless Computing
SMC301 The State of Serverless Computing
 
2016-06 - Design your api management strategy - AWS - Microservices on AWS
2016-06 - Design your api management strategy - AWS - Microservices on AWS2016-06 - Design your api management strategy - AWS - Microservices on AWS
2016-06 - Design your api management strategy - AWS - Microservices on AWS
 
AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)
AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)
AWS re:Invent 2016: Building Complex Serverless Applications (GPST404)
 
AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...
AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...
AWS Public Sector Symposium 2014 Canberra | Compliance and Governance on the ...
 
Wild Rydes - Serverless DevOps to the Rescue
Wild Rydes - Serverless DevOps to the RescueWild Rydes - Serverless DevOps to the Rescue
Wild Rydes - Serverless DevOps to the Rescue
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017
 
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New UnicornWorkshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
Workshop : Wild Rydes Takes Off - The Dawn of a New Unicorn
 

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
 

Recently uploaded

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 

Recently uploaded (20)

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 

Serverless Microservices

  • 1. ©  2016,  Amazon  Web  Services,  Inc.  or  its  Affiliates.  All  rights  reserved. Olivier  Klein  – Emerging  Technologies  Solutions  Architect,  Asia  Pacific September  2016 Serverless Microservices Build  Scalable,  Fault-­Tolerant  and  Transaction-­Safe  Microservices on  AWS
  • 2. Microservices advocate  creating  a  system   from  a  collection  of  small,  isolated  services, each  of  which  owns  their  data,   scalable  and  resilient  to  failure
  • 3. How  to  Build  Application  Backends? Back-­end  logic DatabaseBrowser   /Mobile
  • 4. How  to  Build  Serverless Microservices? AWS   Lambda Amazon  API   Gateway Amazon   DynamoDB Microservice
  • 5. How  to  Build  Serverless Microservices? AWS   Lambda Amazon  API   Gateway Amazon   DynamoDB Microservice 1 Microservice 2 Microservice N ...
  • 6. Amazon  API  Gateway • Create,  publish,  maintain,  monitor  and   secure  RESTful APIs • Powered  by  our  content  delivery   network  via  61  global  edge  locations • Provides DDoS protection  and   throttling capabilities • Multiple  API  stages  which  you  define   (e.g.  dev,  test,  prod) AWS Lambda Amazon API Gateway Amazon EC2 AWS API On-­prem Server
  • 7. Amazon  API  Gateway:  Authorisation Amazon  API   Gateway • Allows  unauthenticated  requests,  or   authorises via  AWS  IAM • Amazon  Cognito or  AWS  STS  for   temporary  credential  generation • API  Keys  available  to  monitor   individual  app  calls • You  can  create  API  Key  specific   throttling and  usage  plans Basic  – 5  TPS Premium  – 100  TPS Power  – No  throttling API  Keys  – Usage  Plans Amazon   Cognito AWS  IAM
  • 9. AWS  Lambda:  Versioning • Immutable versions  of  functions • Per  version  configuration • Per  version  Cloudwatch metrics • Cloudwatch Logs  contain  version   attribute • Aliases  to  “label”  a  version  release • $LATEST  contains  latest  code
  • 10. $LATEST(95) STABLE TESTING 94 X 93 X 92 Update  Alias  to  Deploy
  • 11. $LATEST(95) STABLE TESTING 94 X X 93 92 Update  Alias  to  Deploy
  • 13. API  Gateway  Stage  Variables
  • 14. API  Gateway  Stage  Variables
  • 15. API  Gateway Lambda Custom  Domain /prod/Resources FunctionName:stable https://api.example.com /dev/Resources FunctionName:$LATEST https://dev.example.com /qa/Resources FunctionName:qa https://qa.example.com Pin  your  Environment  with  Stage  Variables
  • 16. Serverless Microservices AWS   Lambda Amazon  API   Gateway • Highly  available • Scalable • Fault  tolerant • Cost  effective • Secure • BUT:  Stateless! Microservice ?
  • 17. Challenge:  Centralised Database user-­svc account-­svccart-­svc DB • Applications  often  have  a   monolithic data  store • Difficult  to  make  schema   changes • Technology  lock-­in • Vertical  scaling • Single  point  of  failure
  • 18. Centralised Database  – Anti-­pattern • Applications  often  have  a   monolithic data  store • Difficult  to  make  schema   changes • Technology  lock-­in • Vertical  scaling • Single  point  of  failure user-­svc account-­svccart-­svc DB
  • 19. Decentralised Data  Stores account-­svccart-­svc DynamoDB RDS user-­svc ElastiCache RDS • Polyglot persistence • Each  service  chooses  it’s   data  store  technology • Low  impact  schema  changes • Independent  scalability • Data  is  gated  through  the   service  API
  • 20. CAP  Theorem It  is  impossible  for  a  distributed  computer  system  to   simultaneously  provide  all  3  of  the  following  guarantees: • Consistency   • Availability • Partition  Tolerance à In  the  presence  of    network  partition  we  need  to  choose   between  consistency and  availability
  • 21. Challenge:  Transactional  Integrity • Polyglot  persistence  generally  translates   into  eventual  consistency • Asynchronous  calls  allow  non-­ blocking,  but  returns  need  to  be  handled   properly • How  about  transactional  integrity? • Event-­sourcing  – Capture  changes  as   sequence  of  events     • Staged  commit • Rollback  on  failure ERROR STATE? ROLLBACK?
  • 22. Let’s  try  a  Demo  – Online  Commerce • Online  commerce  with  microservices to • Checkout  a  cart • Collect  payment • Warehouse  Management • Shipment • High  volume  site,  out  of  stock  errors,  credit   card  payments  with  risk  cut-­off  (<  100  USD) • Demonstrate  successful and  failing   transactions with  graceful  rollback
  • 23. Best  Practice:  Use  Correlation  IDs 09-02-2015 15:03:24 ui-svc INFO [uuid-123] …… 09-02-2015 15:03:25 catalog-svc INFO [uuid-123] …… 09-02-2015 15:03:26 checkout-svc ERROR [uuid-123] …… 09-02-2015 15:03:27 payment-svc INFO [uuid-123] …… 09-02-2015 15:03:27 shipping-svc INFO [uuid-123] …… ui-­svc catalog-­ svc checkout-­ svc shipping-­ svc payment-­ svc request correlation  id:   “uuid-­123” correlation  id:   “uuid-­123”
  • 24. Best  Practice:  Microservice Owns  Rollback • Every  microservice should  expose   it’s  own  “rollback”  method • This  method  could  just  rollback changes,  or  trigger  subsequent   actions (e.g.  send  notification) • If  you  implement  staged  commit,   also  expose  a  commit  function   Microservice Function  1 Rollback Commit (optional)
  • 25. Event-­Driven:  DynamoDB Streams • If  async,  consider  event-­driven   approach  with  DynamoDB Streams • Don’t  need  to  manage  function   execution  failure,  DDB  Streams   automatically  retries  until  successful • “Attach”  yourself  to  the  data  of   interest • Kinesis,  SQS,  SNS  also  possible Microservice
  • 26. Challenge:  Report  Errors  /  Rollback • What  if  functions  fail?  (business  logic   failure,  not  code  failure) • Create  a  “Transaction  Manager”   microservice that  notifies  all  relevant   microservices to  rollback  or  take  action • DynamoDB is  the  trigger for  the  clean-­up function  (could  be  SQS,  Kinesis  etc.) • Use  Correlation  ID  to  identify  relations mm-­svc Transaction   Manager   Function DDB  Streams API  Call Error  Table
  • 27. Challenge:  Report  Errors  /  Rollback ERROR DynamoDB Error  Table Transaction   Manager Function Kinesis Error  Stream SQS Error  Queue Rollback(co rrelation-­id) Rollback(co rrelation-­id) Rollback(co rrelation-­id) Rollback(co rrelation-­id)
  • 28. Challenge:  Code  Error • Lambda  execution  error  because  of   faulty  /  erroneous  code • Leverage  Cloudwatch Logs  to   process  error  message  and  call   transaction  manager • Set  Cloudwatch Logs  metric  filter   to  look  for  error/exception  and  call   Lambda  handler  upon  alarm  state ui-­svc Cloudwatch Logs Cloudwatch Alarm Transaction   Manager   Function
  • 29. Beware:  Stream  Model  with  AWS  Lambda • DynamoDB Streams  and  Kinesis  streams  directly  work   with  AWS  Lambda,  however  AWS  Lambda  needs  to   acknowledge  processing  the  message  correctly • If  Lambda  fails  to  process  the  message,  the  stream   horizon  will  not  be  moved  forward,  creating  a  “jam” • Solution:  Monitor  AWS  Lambda  Error  Cloudwatch Metric  and  react  when  error  rate  of  same  “Correlation  ID”   keeps  increasing
  • 30. MDM  – Keep  Data  Consistent Databases AWS  Lambda “Cleanup”   Function Cloudwatch Scheduled  Event • Perform  Master  Data  Management   (MDM)  to  keep  data  consistent • Create  AWS  Lambda  function  to   check  consistencies  across   microservices and  “cleanup” • Create  Cloudwatch Event to  schedule  the  function   (e.g.  hourly  basis)
  • 31. Final  Thoughts • Use  Amazon  API  Gateway  to  build  a  front-­door  to  all  your   microservices (AWS  Lambda,  Docker,  EC2  etc.) • Use  polyglot  persistence  to  avoid  bottlenecks,  schema   issues  and  allow  independent  scalability  (and  cache) • Embrace  eventual  consistency  and  design  fault-­tolerant   business  processes  which  can  recover • Monitor your  environment  and  cleanup whenever   necessary  (automation  is  your  friend!)