SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data design and modeling for
microservices
Darin Briskman | April 2018
briskman@amazon.com
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices at Amazon
Service-Oriented Architecture
(SOA)
Single-purpose
Connect only through APIs
Connect over HTTPS
“Microservices”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservice Challenges
Distributed computing is hard
Transactions
• Multiple Databases across multiple services
Eventual Consistency
Lots of moving parts
Service discovery
Increase coordination
Increase message routing
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Key Elements of Microservices…
Some core concepts are common to all services
• Service registration, discovery, wiring, administration
• State management
• Service metadata
• Service versioning
• Caching
Low Friction Deployment
Automated Management and Monitoring
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Key Elements of Microservices…
Eliminates any long-term commitment to a technology stack
Polyglot ecosystem
Polyglot persistence
• Decompose Databases
• Database per microservice pattern
Allows easy use of Canary and Blue-Green deployments
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Key Elements of Microservices…
Each microservice is:
• Elastic: scales up or down independently of other services
• Resilient: services provide fault isolation boundaries
• Composable: uniform APIs for each service
• Minimal: highly cohesive set of entities
• Complete: loosely coupled with other services
Controller A Controller B
Controller A Controller B
Q Q
Tight Coupling
Loose Coupling
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices Benefits
Fast to develop
Rapid deployment
Parallel development & deployment
Closely integrated with DevOps
• Now ”DevSecOps”
Improved scalability, availability & fault tolerance
More closely aligned to business domain
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Two-pizza teams
Full ownership
Full accountability
Aligned incentives
“DevOps”
Principles of the Two Pizza Team
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How do Two Pizza Teams work?
We call them “Service teams”
Own the “primitives” they build:
• Product planning (roadmap)
• Development work
• Operational/Client support work
“You build it, you run it”
Part of a larger concentrated org (Amazon.com, AWS,
Prime, etc)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Architecture Challenges
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Challenge: Centralized 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
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Centralized 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
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Decentralized 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
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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”
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Best Practice: Microservice owns Rollback
• Every microservice should expose
it’s own “rollback” method
• This method could just rollback
changes, or trigger subsequent
actions
• Could send a notification
• If you implement staged commit,
also expose a commit function
Microservice
Function 1
Rollback
Commit
(optional)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
Microservice
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Challenge: Report Errors / Rollback
ERROR
DynamoDB
Error Table
Transaction
Manager
Function
Kinesis
Error Stream
SQS
Error Queue
Rollback
(correlation-id)
Rollback
(correlation-id)
Rollback
(correlation-id)
Rollback
(correlation-id)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Challenge: Code Error
• Lambda Execution Error because of
faulty 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
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
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 a Cloudwatch Event
to schedule the function
(e.g. hourly basis)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Choosing a Datastore
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Storage & DB options in AWS
Amazon
RDS
Amazon
DynamoDB
Amazon
Elasticsearch
Service
Amazon
S3
Amazon
Kinesis
Amazon
ElastiCache
In-Memory NoSQL SQL SearchObject Streaming
Amazon
Redshift
Amazon
Glacier
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service
Amazon
Elasticsearch
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Challenge: What Service to Use?
Many problems can be solved with NoSQL, RDBMS or
even in-memory cache technologies
Non-functional requirements can help identify appropriate
services
Solution: Classify your organizations non-functional
requirements and map them to service capabilities
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Determine Your Non-Functional Requirements
Requirement
Latency > 1s 200 ms -1s 20 ms – 200 ms < 20 ms
Durability 99.99 99.999 99.9999 > 99.9999
Storage Scale < 256 GB 256 GB – 1 TB 1 TB – 16 TB > 16 TB
Availability 99 99.9 99.95 > 99.95
Data Class Public Important Secret Top Secret
Recoverability 12 – 24 hours 1 – 12 hours 5 mins – 1 hour < 5 mins
Skills None Average Good Expert
This is only an example. Your company’s classifications will be different
There will be other requirements such as regulatory compliance too.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Map Non-Functional Requirements to Services
Service Latency Durability Storage Availability Recoverability from AZ Failure
(RPO, RTO)
RDS
< 100 ms > 99.8 (EBS) 6 TB (SQL
Server 16 TB)
99.95 0s and 90s (MAZ)
Aurora < 100 ms > 99.9 64 TB > 99.95 0s and < 30s (MAZ)
Aurora + ElastiCache < 1 ms > 99.9 64 TB > 99.95 0s and < 30s (MAZ)
DynamoDB < 10 ms > 99.9 No Limit > 99.99 0s and 0s
DynamoDB / DAX < 1 ms > 99.9 No Limit > 99.99 0s and 0s
ElastiCache Redis < 1 ms N/A 3.5 TiB 99.95 0s and < 30s (MAZ)
Elasticsearch < 200 ms > 99.9 150 TB 99.95 0s and < 30s (Zone Aware)
S3 < 500 ms 99.999999999 No Limit 99.99 0s and 0s
The information below is not exact and does not represent SLAs
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Finalizing Your Data Store Choices
After mapping your non-functional requirements to services you
should have a short list to choose from
Functional requirements such as geospatial data and query support
will refine the list further
You may institute standards to make data store selection simpler and
also make it easier for people to move between teams, e.g Redis
over Memcached and PostgreSQL over MySQL. These can still be
overridden, but require justification to senior management
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Challenge: Reporting and Analytics
Data is now spread across a number of isolated polyglot
data stores
Consolidation and aggregation required
Solution: Pull data from required microservices, push
data to data aggregation service, use pub/sub. Don’t use
a composite service (anti-pattern).
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aggregation
usr svc
Pull model Push model
Data Aggregation
Application
usr svc
Data
Aggregation
Application
Pub/Sub Composite
Composite Data Service
usr account cart
account svc cart svc
account svc
cart svc
Pub Sub
usr svc
account svc
cart svc
Data
Aggregation
Application
Push
Pull
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A Few Thoughts
• Use Non-Functional Requirements to help identify the
right data store(s) for each microservice
• 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
• Think ahead and plan your analytics requirements as
part of the overall architecture
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
… and thanks to our sponsors!
Ad

More Related Content

What's hot (20)

Toyota 7 fb20 forklift service repair manual
Toyota 7 fb20 forklift service repair manualToyota 7 fb20 forklift service repair manual
Toyota 7 fb20 forklift service repair manual
fjsekdmmeed
 
Guindastes Veronezi - Componentes do Guindaste
Guindastes Veronezi -  Componentes do GuindasteGuindastes Veronezi -  Componentes do Guindaste
Guindastes Veronezi - Componentes do Guindaste
Veronezi Guindastes
 
Caidas al mismo nivel
Caidas al mismo nivelCaidas al mismo nivel
Caidas al mismo nivel
Siho Man
 
Curso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptx
Curso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptxCurso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptx
Curso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptx
JOSE_ROSAS1810
 
Identificación de-peligros-evaluación-de-riesgos-y-determinación-de-controles
Identificación de-peligros-evaluación-de-riesgos-y-determinación-de-controlesIdentificación de-peligros-evaluación-de-riesgos-y-determinación-de-controles
Identificación de-peligros-evaluación-de-riesgos-y-determinación-de-controles
Aldair Callo
 
Singing Rock Catalogo Profesional y Empresas
Singing Rock Catalogo Profesional y EmpresasSinging Rock Catalogo Profesional y Empresas
Singing Rock Catalogo Profesional y Empresas
Esteller
 
Normas de uso de maquinas
Normas de uso de maquinasNormas de uso de maquinas
Normas de uso de maquinas
Prof. Morales - Educación Tecnológica
 
Motoguadaña
MotoguadañaMotoguadaña
Motoguadaña
Enrique Peralta Alvites
 
Triptico PEO-EHS-003 R10 Rescate en Altura.pdf
Triptico PEO-EHS-003 R10 Rescate en Altura.pdfTriptico PEO-EHS-003 R10 Rescate en Altura.pdf
Triptico PEO-EHS-003 R10 Rescate en Altura.pdf
EdgarEduardoGonzalez10
 
Petar trabajos en altura y inspeccion de equipo anticaidas
Petar trabajos en altura y inspeccion de equipo anticaidasPetar trabajos en altura y inspeccion de equipo anticaidas
Petar trabajos en altura y inspeccion de equipo anticaidas
jesus vera
 
Curso de vigias y cuadradores
Curso de vigias y cuadradoresCurso de vigias y cuadradores
Curso de vigias y cuadradores
Jaime de la Gala
 
Manual de Operação empilhadeira Toyota.pdf
Manual de Operação empilhadeira Toyota.pdfManual de Operação empilhadeira Toyota.pdf
Manual de Operação empilhadeira Toyota.pdf
ssuser3c9e601
 
Ficha tecnica photobeam
Ficha tecnica photobeamFicha tecnica photobeam
Ficha tecnica photobeam
Jefferson Salinas
 
Equipo de protección personal presentacion
Equipo de protección personal presentacionEquipo de protección personal presentacion
Equipo de protección personal presentacion
tomasgomez11
 
Charlas diarias de seguridad de 5 minutos
Charlas diarias de seguridad de 5 minutosCharlas diarias de seguridad de 5 minutos
Charlas diarias de seguridad de 5 minutos
coordinador2
 
A trava do gancho e obrigatoria
A trava do gancho e obrigatoriaA trava do gancho e obrigatoria
A trava do gancho e obrigatoria
Gustavo Cassiolato
 
Cursos
CursosCursos
Cursos
yanishita
 
Como evitar acidentes trabalhos em telhados
Como evitar acidentes trabalhos em telhadosComo evitar acidentes trabalhos em telhados
Como evitar acidentes trabalhos em telhados
Cosmo Palasio
 
Checklist betoneira
Checklist betoneiraChecklist betoneira
Checklist betoneira
NRFACIL www.nrfacil.com.br
 
Iram 3622 1 protección individual contra caidas
Iram 3622 1 protección individual contra caidasIram 3622 1 protección individual contra caidas
Iram 3622 1 protección individual contra caidas
igcardona5533
 
Toyota 7 fb20 forklift service repair manual
Toyota 7 fb20 forklift service repair manualToyota 7 fb20 forklift service repair manual
Toyota 7 fb20 forklift service repair manual
fjsekdmmeed
 
Guindastes Veronezi - Componentes do Guindaste
Guindastes Veronezi -  Componentes do GuindasteGuindastes Veronezi -  Componentes do Guindaste
Guindastes Veronezi - Componentes do Guindaste
Veronezi Guindastes
 
Caidas al mismo nivel
Caidas al mismo nivelCaidas al mismo nivel
Caidas al mismo nivel
Siho Man
 
Curso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptx
Curso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptxCurso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptx
Curso-NOM-009-STPS-TRABAJOS-EN-ALTURAS-pptx.pptx
JOSE_ROSAS1810
 
Identificación de-peligros-evaluación-de-riesgos-y-determinación-de-controles
Identificación de-peligros-evaluación-de-riesgos-y-determinación-de-controlesIdentificación de-peligros-evaluación-de-riesgos-y-determinación-de-controles
Identificación de-peligros-evaluación-de-riesgos-y-determinación-de-controles
Aldair Callo
 
Singing Rock Catalogo Profesional y Empresas
Singing Rock Catalogo Profesional y EmpresasSinging Rock Catalogo Profesional y Empresas
Singing Rock Catalogo Profesional y Empresas
Esteller
 
Triptico PEO-EHS-003 R10 Rescate en Altura.pdf
Triptico PEO-EHS-003 R10 Rescate en Altura.pdfTriptico PEO-EHS-003 R10 Rescate en Altura.pdf
Triptico PEO-EHS-003 R10 Rescate en Altura.pdf
EdgarEduardoGonzalez10
 
Petar trabajos en altura y inspeccion de equipo anticaidas
Petar trabajos en altura y inspeccion de equipo anticaidasPetar trabajos en altura y inspeccion de equipo anticaidas
Petar trabajos en altura y inspeccion de equipo anticaidas
jesus vera
 
Curso de vigias y cuadradores
Curso de vigias y cuadradoresCurso de vigias y cuadradores
Curso de vigias y cuadradores
Jaime de la Gala
 
Manual de Operação empilhadeira Toyota.pdf
Manual de Operação empilhadeira Toyota.pdfManual de Operação empilhadeira Toyota.pdf
Manual de Operação empilhadeira Toyota.pdf
ssuser3c9e601
 
Equipo de protección personal presentacion
Equipo de protección personal presentacionEquipo de protección personal presentacion
Equipo de protección personal presentacion
tomasgomez11
 
Charlas diarias de seguridad de 5 minutos
Charlas diarias de seguridad de 5 minutosCharlas diarias de seguridad de 5 minutos
Charlas diarias de seguridad de 5 minutos
coordinador2
 
A trava do gancho e obrigatoria
A trava do gancho e obrigatoriaA trava do gancho e obrigatoria
A trava do gancho e obrigatoria
Gustavo Cassiolato
 
Como evitar acidentes trabalhos em telhados
Como evitar acidentes trabalhos em telhadosComo evitar acidentes trabalhos em telhados
Como evitar acidentes trabalhos em telhados
Cosmo Palasio
 
Iram 3622 1 protección individual contra caidas
Iram 3622 1 protección individual contra caidasIram 3622 1 protección individual contra caidas
Iram 3622 1 protección individual contra caidas
igcardona5533
 

Similar to Data Design and Modeling for Microservices I AWS Dev Day 2018 (6)

Microservices and Data Design
Microservices and Data DesignMicroservices and Data Design
Microservices and Data Design
AWS Germany
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
Vladimir Simek
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
Monica Lora
 
2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd
Kim Kao
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
Steven Bryen
 
How can your business benefit from going serverless?
How can your business benefit from going serverless?How can your business benefit from going serverless?
How can your business benefit from going serverless?
Adrian Hornsby
 
Microservices and Data Design
Microservices and Data DesignMicroservices and Data Design
Microservices and Data Design
AWS Germany
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
Vladimir Simek
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
Monica Lora
 
2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd2019 03-13-implementing microservices by ddd
2019 03-13-implementing microservices by ddd
Kim Kao
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
Steven Bryen
 
How can your business benefit from going serverless?
How can your business benefit from going serverless?How can your business benefit from going serverless?
How can your business benefit from going serverless?
Adrian Hornsby
 
Ad

More from AWS Germany (20)

Analytics Web Day | From Theory to Practice: Big Data Stories from the Field
Analytics Web Day | From Theory to Practice: Big Data Stories from the FieldAnalytics Web Day | From Theory to Practice: Big Data Stories from the Field
Analytics Web Day | From Theory to Practice: Big Data Stories from the Field
AWS Germany
 
Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...
Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...
Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...
AWS Germany
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
AWS Germany
 
Modern Applications Web Day | Manage Your Infrastructure and Configuration on...
Modern Applications Web Day | Manage Your Infrastructure and Configuration on...Modern Applications Web Day | Manage Your Infrastructure and Configuration on...
Modern Applications Web Day | Manage Your Infrastructure and Configuration on...
AWS Germany
 
Modern Applications Web Day | Container Workloads on AWS
Modern Applications Web Day | Container Workloads on AWSModern Applications Web Day | Container Workloads on AWS
Modern Applications Web Day | Container Workloads on AWS
AWS Germany
 
Modern Applications Web Day | Continuous Delivery to Amazon EKS with Spinnaker
Modern Applications Web Day | Continuous Delivery to Amazon EKS with SpinnakerModern Applications Web Day | Continuous Delivery to Amazon EKS with Spinnaker
Modern Applications Web Day | Continuous Delivery to Amazon EKS with Spinnaker
AWS Germany
 
Building Smart Home skills for Alexa
Building Smart Home skills for AlexaBuilding Smart Home skills for Alexa
Building Smart Home skills for Alexa
AWS Germany
 
Hotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructure
Hotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructureHotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructure
Hotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructure
AWS Germany
 
Wild Rydes with Big Data/Kinesis focus: AWS Serverless Workshop
Wild Rydes with Big Data/Kinesis focus: AWS Serverless WorkshopWild Rydes with Big Data/Kinesis focus: AWS Serverless Workshop
Wild Rydes with Big Data/Kinesis focus: AWS Serverless Workshop
AWS Germany
 
Log Analytics with AWS
Log Analytics with AWSLog Analytics with AWS
Log Analytics with AWS
AWS Germany
 
Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS
Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS
Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS
AWS Germany
 
AWS Programme für Nonprofits
AWS Programme für NonprofitsAWS Programme für Nonprofits
AWS Programme für Nonprofits
AWS Germany
 
Serverless vs. Developers – the real crash
Serverless vs. Developers – the real crashServerless vs. Developers – the real crash
Serverless vs. Developers – the real crash
AWS Germany
 
Query your data in S3 with SQL and optimize for cost and performance
Query your data in S3 with SQL and optimize for cost and performanceQuery your data in S3 with SQL and optimize for cost and performance
Query your data in S3 with SQL and optimize for cost and performance
AWS Germany
 
Secret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s VaultSecret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s Vault
AWS Germany
 
EKS Workshop
 EKS Workshop EKS Workshop
EKS Workshop
AWS Germany
 
Scale to Infinity with ECS
Scale to Infinity with ECSScale to Infinity with ECS
Scale to Infinity with ECS
AWS Germany
 
Containers on AWS - State of the Union
Containers on AWS - State of the UnionContainers on AWS - State of the Union
Containers on AWS - State of the Union
AWS Germany
 
Deploying and Scaling Your First Cloud Application with Amazon Lightsail
Deploying and Scaling Your First Cloud Application with Amazon LightsailDeploying and Scaling Your First Cloud Application with Amazon Lightsail
Deploying and Scaling Your First Cloud Application with Amazon Lightsail
AWS Germany
 
Building Personalized Data Products - From Idea to Product
Building Personalized Data Products - From Idea to ProductBuilding Personalized Data Products - From Idea to Product
Building Personalized Data Products - From Idea to Product
AWS Germany
 
Analytics Web Day | From Theory to Practice: Big Data Stories from the Field
Analytics Web Day | From Theory to Practice: Big Data Stories from the FieldAnalytics Web Day | From Theory to Practice: Big Data Stories from the Field
Analytics Web Day | From Theory to Practice: Big Data Stories from the Field
AWS Germany
 
Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...
Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...
Analytics Web Day | Query your Data in S3 with SQL and optimize for Cost and ...
AWS Germany
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...Modern Applications Web Day | Impress Your Friends with Your First Serverless...
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
AWS Germany
 
Modern Applications Web Day | Manage Your Infrastructure and Configuration on...
Modern Applications Web Day | Manage Your Infrastructure and Configuration on...Modern Applications Web Day | Manage Your Infrastructure and Configuration on...
Modern Applications Web Day | Manage Your Infrastructure and Configuration on...
AWS Germany
 
Modern Applications Web Day | Container Workloads on AWS
Modern Applications Web Day | Container Workloads on AWSModern Applications Web Day | Container Workloads on AWS
Modern Applications Web Day | Container Workloads on AWS
AWS Germany
 
Modern Applications Web Day | Continuous Delivery to Amazon EKS with Spinnaker
Modern Applications Web Day | Continuous Delivery to Amazon EKS with SpinnakerModern Applications Web Day | Continuous Delivery to Amazon EKS with Spinnaker
Modern Applications Web Day | Continuous Delivery to Amazon EKS with Spinnaker
AWS Germany
 
Building Smart Home skills for Alexa
Building Smart Home skills for AlexaBuilding Smart Home skills for Alexa
Building Smart Home skills for Alexa
AWS Germany
 
Hotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructure
Hotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructureHotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructure
Hotel or Taxi? "Sorting hat" for travel expenses with AWS ML infrastructure
AWS Germany
 
Wild Rydes with Big Data/Kinesis focus: AWS Serverless Workshop
Wild Rydes with Big Data/Kinesis focus: AWS Serverless WorkshopWild Rydes with Big Data/Kinesis focus: AWS Serverless Workshop
Wild Rydes with Big Data/Kinesis focus: AWS Serverless Workshop
AWS Germany
 
Log Analytics with AWS
Log Analytics with AWSLog Analytics with AWS
Log Analytics with AWS
AWS Germany
 
Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS
Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS
Deep Dive into Concepts and Tools for Analyzing Streaming Data on AWS
AWS Germany
 
AWS Programme für Nonprofits
AWS Programme für NonprofitsAWS Programme für Nonprofits
AWS Programme für Nonprofits
AWS Germany
 
Serverless vs. Developers – the real crash
Serverless vs. Developers – the real crashServerless vs. Developers – the real crash
Serverless vs. Developers – the real crash
AWS Germany
 
Query your data in S3 with SQL and optimize for cost and performance
Query your data in S3 with SQL and optimize for cost and performanceQuery your data in S3 with SQL and optimize for cost and performance
Query your data in S3 with SQL and optimize for cost and performance
AWS Germany
 
Secret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s VaultSecret Management with Hashicorp’s Vault
Secret Management with Hashicorp’s Vault
AWS Germany
 
Scale to Infinity with ECS
Scale to Infinity with ECSScale to Infinity with ECS
Scale to Infinity with ECS
AWS Germany
 
Containers on AWS - State of the Union
Containers on AWS - State of the UnionContainers on AWS - State of the Union
Containers on AWS - State of the Union
AWS Germany
 
Deploying and Scaling Your First Cloud Application with Amazon Lightsail
Deploying and Scaling Your First Cloud Application with Amazon LightsailDeploying and Scaling Your First Cloud Application with Amazon Lightsail
Deploying and Scaling Your First Cloud Application with Amazon Lightsail
AWS Germany
 
Building Personalized Data Products - From Idea to Product
Building Personalized Data Products - From Idea to ProductBuilding Personalized Data Products - From Idea to Product
Building Personalized Data Products - From Idea to Product
AWS Germany
 
Ad

Recently uploaded (20)

Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Build With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdfBuild With AI - In Person Session Slides.pdf
Build With AI - In Person Session Slides.pdf
Google Developer Group - Harare
 
Agentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community MeetupAgentic Automation - Delhi UiPath Community Meetup
Agentic Automation - Delhi UiPath Community Meetup
Manoj Batra (1600 + Connections)
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient CareAn Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
Cyntexa
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 
Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)Design pattern talk by Kaya Weers - 2025 (v2)
Design pattern talk by Kaya Weers - 2025 (v2)
Kaya Weers
 
Developing System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptxDeveloping System Infrastructure Design Plan.pptx
Developing System Infrastructure Design Plan.pptx
wondimagegndesta
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à GenèveUiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPath Automation Suite – Cas d'usage d'une NGO internationale basée à Genève
UiPathCommunity
 
AI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamsonAI-proof your career by Olivier Vroom and David WIlliamson
AI-proof your career by Olivier Vroom and David WIlliamson
UXPA Boston
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Unlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web AppsUnlocking Generative AI in your Web Apps
Unlocking Generative AI in your Web Apps
Maximiliano Firtman
 
Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?Shoehorning dependency injection into a FP language, what does it take?
Shoehorning dependency injection into a FP language, what does it take?
Eric Torreborre
 
Top-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptxTop-AI-Based-Tools-for-Game-Developers (1).pptx
Top-AI-Based-Tools-for-Game-Developers (1).pptx
BR Softech
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
IT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information TechnologyIT488 Wireless Sensor Networks_Information Technology
IT488 Wireless Sensor Networks_Information Technology
SHEHABALYAMANI
 
Mastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B LandscapeMastering Testing in the Modern F&B Landscape
Mastering Testing in the Modern F&B Landscape
marketing943205
 
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
RTP Over QUIC: An Interesting Opportunity Or Wasted Time?
Lorenzo Miniero
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient CareAn Overview of Salesforce Health Cloud & How is it Transforming Patient Care
An Overview of Salesforce Health Cloud & How is it Transforming Patient Care
Cyntexa
 
Slack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teamsSlack like a pro: strategies for 10x engineering teams
Slack like a pro: strategies for 10x engineering teams
Nacho Cougil
 
Dark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanizationDark Dynamism: drones, dark factories and deurbanization
Dark Dynamism: drones, dark factories and deurbanization
Jakub Šimek
 

Data Design and Modeling for Microservices I AWS Dev Day 2018

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data design and modeling for microservices Darin Briskman | April 2018 briskman@amazon.com
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Microservices at Amazon Service-Oriented Architecture (SOA) Single-purpose Connect only through APIs Connect over HTTPS “Microservices”
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Microservice Challenges Distributed computing is hard Transactions • Multiple Databases across multiple services Eventual Consistency Lots of moving parts Service discovery Increase coordination Increase message routing
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Key Elements of Microservices… Some core concepts are common to all services • Service registration, discovery, wiring, administration • State management • Service metadata • Service versioning • Caching Low Friction Deployment Automated Management and Monitoring
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Key Elements of Microservices… Eliminates any long-term commitment to a technology stack Polyglot ecosystem Polyglot persistence • Decompose Databases • Database per microservice pattern Allows easy use of Canary and Blue-Green deployments
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Key Elements of Microservices… Each microservice is: • Elastic: scales up or down independently of other services • Resilient: services provide fault isolation boundaries • Composable: uniform APIs for each service • Minimal: highly cohesive set of entities • Complete: loosely coupled with other services Controller A Controller B Controller A Controller B Q Q Tight Coupling Loose Coupling
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Microservices Benefits Fast to develop Rapid deployment Parallel development & deployment Closely integrated with DevOps • Now ”DevSecOps” Improved scalability, availability & fault tolerance More closely aligned to business domain
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Two-pizza teams Full ownership Full accountability Aligned incentives “DevOps” Principles of the Two Pizza Team
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How do Two Pizza Teams work? We call them “Service teams” Own the “primitives” they build: • Product planning (roadmap) • Development work • Operational/Client support work “You build it, you run it” Part of a larger concentrated org (Amazon.com, AWS, Prime, etc)
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Architecture Challenges
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Challenge: Centralized 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
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Centralized 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
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Decentralized 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
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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?
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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”
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Best Practice: Microservice owns Rollback • Every microservice should expose it’s own “rollback” method • This method could just rollback changes, or trigger subsequent actions • Could send a notification • If you implement staged commit, also expose a commit function Microservice Function 1 Rollback Commit (optional)
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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 Microservice
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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
  • 19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Challenge: Report Errors / Rollback ERROR DynamoDB Error Table Transaction Manager Function Kinesis Error Stream SQS Error Queue Rollback (correlation-id) Rollback (correlation-id) Rollback (correlation-id) Rollback (correlation-id)
  • 20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Challenge: Code Error • Lambda Execution Error because of faulty 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
  • 21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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
  • 22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. 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 a Cloudwatch Event to schedule the function (e.g. hourly basis)
  • 23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Choosing a Datastore
  • 24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Storage & DB options in AWS Amazon RDS Amazon DynamoDB Amazon Elasticsearch Service Amazon S3 Amazon Kinesis Amazon ElastiCache In-Memory NoSQL SQL SearchObject Streaming Amazon Redshift Amazon Glacier
  • 25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Service Amazon Elasticsearch
  • 26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Challenge: What Service to Use? Many problems can be solved with NoSQL, RDBMS or even in-memory cache technologies Non-functional requirements can help identify appropriate services Solution: Classify your organizations non-functional requirements and map them to service capabilities
  • 27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Determine Your Non-Functional Requirements Requirement Latency > 1s 200 ms -1s 20 ms – 200 ms < 20 ms Durability 99.99 99.999 99.9999 > 99.9999 Storage Scale < 256 GB 256 GB – 1 TB 1 TB – 16 TB > 16 TB Availability 99 99.9 99.95 > 99.95 Data Class Public Important Secret Top Secret Recoverability 12 – 24 hours 1 – 12 hours 5 mins – 1 hour < 5 mins Skills None Average Good Expert This is only an example. Your company’s classifications will be different There will be other requirements such as regulatory compliance too.
  • 28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Map Non-Functional Requirements to Services Service Latency Durability Storage Availability Recoverability from AZ Failure (RPO, RTO) RDS < 100 ms > 99.8 (EBS) 6 TB (SQL Server 16 TB) 99.95 0s and 90s (MAZ) Aurora < 100 ms > 99.9 64 TB > 99.95 0s and < 30s (MAZ) Aurora + ElastiCache < 1 ms > 99.9 64 TB > 99.95 0s and < 30s (MAZ) DynamoDB < 10 ms > 99.9 No Limit > 99.99 0s and 0s DynamoDB / DAX < 1 ms > 99.9 No Limit > 99.99 0s and 0s ElastiCache Redis < 1 ms N/A 3.5 TiB 99.95 0s and < 30s (MAZ) Elasticsearch < 200 ms > 99.9 150 TB 99.95 0s and < 30s (Zone Aware) S3 < 500 ms 99.999999999 No Limit 99.99 0s and 0s The information below is not exact and does not represent SLAs
  • 29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Finalizing Your Data Store Choices After mapping your non-functional requirements to services you should have a short list to choose from Functional requirements such as geospatial data and query support will refine the list further You may institute standards to make data store selection simpler and also make it easier for people to move between teams, e.g Redis over Memcached and PostgreSQL over MySQL. These can still be overridden, but require justification to senior management
  • 30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Challenge: Reporting and Analytics Data is now spread across a number of isolated polyglot data stores Consolidation and aggregation required Solution: Pull data from required microservices, push data to data aggregation service, use pub/sub. Don’t use a composite service (anti-pattern).
  • 31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aggregation usr svc Pull model Push model Data Aggregation Application usr svc Data Aggregation Application Pub/Sub Composite Composite Data Service usr account cart account svc cart svc account svc cart svc Pub Sub usr svc account svc cart svc Data Aggregation Application Push Pull
  • 32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A Few Thoughts • Use Non-Functional Requirements to help identify the right data store(s) for each microservice • 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 • Think ahead and plan your analytics requirements as part of the overall architecture
  • 33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! … and thanks to our sponsors!

Editor's Notes

  • #4: the second you introduce distributed, you need to leverage infrastructure that addresses network latency, fault tolerance, message serialization, unreliable networks, asynchronicity, versioning, varying loads within the application tiers etc. etc. Otherwise you're coding it yourself, a la NetFlix OSS and I suspect that is one of the main reasons for monolithic shops not being interested. Takes top level talent at the moment, not something all enterprises have access to.
  • #6: Canary release is a technique to reduce the risk of introducing a new software version in production by slowly rolling out the change to a small subset of users before rolling it out to the entire infrastructure and making it available to everybody. Similar to a BlueGreenDeployment (side by side environment – when you are happy you switch all at once) , you start by deploying the new version of your software to a subset of your infrastructure, to which no users are routed.
  翻译: