SlideShare une entreprise Scribd logo
1  sur  42
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A Modern Data Architecture for
Microservices
Blair Layton
Business Development Manager
Database Services
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What to Expect from the Session
• Microservices at AWS
• Overview and Challenges
• Key Elements and Benefits
• Two Pizza Teams
• Data Architecture Challenges
• Transactions and Rollbacks
• Streams
• Master Data Management
• Choosing a Data Store
• Aggregation
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices at AWS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices at AWS
Service-Oriented Architecture
(SOA)
Single-purpose
Connect only through APIs
Connect over HTTPS
“Microservices”
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monolithic vs. SOA vs. Microservices
Microservices:
Many very small components
Business logic lives inside of
single service domain
Simple wire protocols(HTTP
with XML/JSON)
API driven with SDKs/Clients
SOA:
Fewer more sophisticated
components
Business logic can live across
domains
Enterprise Service Bus like
layers between services
Middleware
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monolithic vs. SOA vs. Microservices
SOA
Coarse-grained
Microservices
Fine-grained
Monolithic
Single Unit
© 2017, 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
© 2017, 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
© 2017, 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
© 2017, 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
© 2017, 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
© 2017, 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
© 2017, 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)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Data Architecture Challenges
© 2017, 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
© 2017, 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
© 2017, 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
© 2017, 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?
© 2017, 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”
© 2017, 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)
© 2017, 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
© 2017, 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
© 2017, 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)
© 2017, 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
© 2017, 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
© 2017, 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 Cloudwatch Event
to schedule the function
(e.g. hourly basis)
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Choosing a Datastore
© 2017, 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service
© 2017, 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
© 2017, 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.
© 2017, 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.8 (EBS) 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
© 2017, 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
© 2017, 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, or use a
composite service (anti-pattern).
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aggregation
usr svc
Pull model
Data Aggregation
Application
account svc cart svc
Pull
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Aggregation
usr svc
Pull model Push model
Data Aggregation
Application
account svc cart svc
usr svc
account svc
cart svc
Data
Aggregation
Application
Push
Pull
© 2017, 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
account svc cart svc
account svc
cart svc
Pub Sub
usr svc
account svc
cart svc
Data
Aggregation
Application
Push
Pull
© 2017, 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
© 2017, 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
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Learn from our Customers
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank You for Attending the Webinar
We hope you found it interesting! A kind reminder to complete the survey.
Let us know what you thought of today’s event and how we can improve
the event experience for you in the future.
aws-apac-marketing@amazon.com
twitter.com/AWSCloud
facbook.com/AmazonWebServices
youtube.com/user/AmazonWebServices
slideshare.net/AmazonWebServices
twitch.tv/aws
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
New to AWS
Introductory labs
and videos can
help you ramp up
Start learning
Take a Class
Build technical
skills and learn
best practices from
an accredited
instructor
Find a class
AWS Certification
Validate knowledge
and show expertise
with industry
recognized
certifications
Get Certified
Online Labs
Take an online
Self-Paced Lab to
get hands-on-
practice with AWS
services
Start practicing
Learn more: aws.amazon.com/training

Contenu connexe

Tendances

AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성
AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성
AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성Amazon Web Services Korea
 
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovationsre:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovationsGrant McAlister
 
Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...
Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...
Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...Amazon Web Services
 
Microsoft Azure - Introduction
Microsoft Azure - IntroductionMicrosoft Azure - Introduction
Microsoft Azure - IntroductionPranav Ainavolu
 
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나Amazon Web Services Korea
 
Microsoft Azure Technical Overview
Microsoft Azure Technical OverviewMicrosoft Azure Technical Overview
Microsoft Azure Technical Overviewgjuljo
 
Understanding Azure Disaster Recovery
Understanding Azure Disaster RecoveryUnderstanding Azure Disaster Recovery
Understanding Azure Disaster RecoveryNew Horizons Ireland
 
AZ-900 Azure Fundamentals.pdf
AZ-900 Azure Fundamentals.pdfAZ-900 Azure Fundamentals.pdf
AZ-900 Azure Fundamentals.pdfssuser5813861
 
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나Amazon Web Services Korea
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsAmazon Web Services
 
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...Amazon Web Services Korea
 
AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS ::: Game...
AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS :::  Game...AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS :::  Game...
AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS ::: Game...Amazon Web Services Korea
 
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive [2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive Amazon Web Services Korea
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Amazon Web Services Korea
 

Tendances (20)

AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성
AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성
AWS Summit Seoul 2023 | AWS에서 최소한의 비용으로 구현하는 멀티리전 DR 자동화 구성
 
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovationsre:Invent 2022  DAT326 Deep dive into Amazon Aurora and its innovations
re:Invent 2022 DAT326 Deep dive into Amazon Aurora and its innovations
 
Introduction to Microsoft Azure Cloud
Introduction to Microsoft Azure CloudIntroduction to Microsoft Azure Cloud
Introduction to Microsoft Azure Cloud
 
Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...
Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...
Migrating Single-Tenant Applications to Multi-Tenant SaaS (ARC326-R1) - AWS r...
 
Azure Security Overview
Azure Security OverviewAzure Security Overview
Azure Security Overview
 
Microsoft Azure - Introduction
Microsoft Azure - IntroductionMicrosoft Azure - Introduction
Microsoft Azure - Introduction
 
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
Amazon RDS Proxy 집중 탐구 - 윤석찬 :: AWS Unboxing 온라인 세미나
 
Introduction to Amazon Aurora
Introduction to Amazon AuroraIntroduction to Amazon Aurora
Introduction to Amazon Aurora
 
Microsoft Azure Technical Overview
Microsoft Azure Technical OverviewMicrosoft Azure Technical Overview
Microsoft Azure Technical Overview
 
Understanding Azure Disaster Recovery
Understanding Azure Disaster RecoveryUnderstanding Azure Disaster Recovery
Understanding Azure Disaster Recovery
 
AZ-900 Azure Fundamentals.pdf
AZ-900 Azure Fundamentals.pdfAZ-900 Azure Fundamentals.pdf
AZ-900 Azure Fundamentals.pdf
 
Amazon RDS Deep Dive
Amazon RDS Deep DiveAmazon RDS Deep Dive
Amazon RDS Deep Dive
 
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
AWS 기반 데이터 레이크(Datalake) 구축 및 분석 - 김민성 (AWS 솔루션즈아키텍트) : 8월 온라인 세미나
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
 
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
Amazon DynamoDB - Use Cases and Cost Optimization - 발표자: 이혁, DynamoDB Special...
 
AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS ::: Game...
AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS :::  Game...AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS :::  Game...
AWS for Games - 게임만을 위한 AWS 서비스 길라잡이 (레벨 200) - 진교선, 솔루션즈 아키텍트, AWS ::: Game...
 
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive [2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
[2017 AWS Startup Day] AWS 비용 최대 90% 절감하기: 스팟 인스턴스 Deep-Dive
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
Internal Architecture of Amazon Aurora (Level 400) - 발표자: 정달영, APAC RDS Speci...
 

Similaire à A Modern Data Architecture for Microservices

Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Amazon Web Services
 
Microservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SFMicroservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SFAmazon Web Services
 
Microservices and Data Design
Microservices and Data DesignMicroservices and Data Design
Microservices and Data DesignAWS Germany
 
Microservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San FranciscoMicroservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San FranciscoAmazon Web Services
 
Microservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel CervantesMicroservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel CervantesAmazon 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
 
Introduction to the Serverless Cloud
Introduction to the Serverless CloudIntroduction to the Serverless Cloud
Introduction to the Serverless CloudAmazon Web Services
 
Serverless: State of The Union I AWS Dev Day 2018
Serverless: State of The Union I AWS Dev Day 2018Serverless: State of The Union I AWS Dev Day 2018
Serverless: State of The Union I AWS Dev Day 2018AWS Germany
 
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Amazon Web Services
 
What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017Amazon Web Services
 
How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsAmazon Web Services
 
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Amazon Web Services
 
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...Amazon Web Services
 
From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...
From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...
From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...Amazon Web Services
 
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAmazon Web Services
 
規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐Amazon Web Services
 

Similaire à A Modern Data Architecture for Microservices (20)

Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2Data Design for Microservices - DevDay Austin 2017 Day 2
Data Design for Microservices - DevDay Austin 2017 Day 2
 
Microservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SFMicroservices & Data Design: Database Week SF
Microservices & Data Design: Database Week SF
 
Microservices and Data Design
Microservices and Data DesignMicroservices and Data Design
Microservices and Data Design
 
Microservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San FranciscoMicroservices & Data Design: Database Week San Francisco
Microservices & Data Design: Database Week San Francisco
 
Microservices & Data Design
Microservices & Data DesignMicroservices & Data Design
Microservices & Data Design
 
Microservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel CervantesMicroservices: Data & Design - Miguel Cervantes
Microservices: Data & Design - Miguel Cervantes
 
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
 
Introduction to the Serverless Cloud
Introduction to the Serverless CloudIntroduction to the Serverless Cloud
Introduction to the Serverless Cloud
 
Serverless: State of The Union I AWS Dev Day 2018
Serverless: State of The Union I AWS Dev Day 2018Serverless: State of The Union I AWS Dev Day 2018
Serverless: State of The Union I AWS Dev Day 2018
 
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
Navigating Microservice Architecture with AWS - AWS Public Sector Summit Sing...
 
Data Design for Microservices
Data Design for MicroservicesData Design for Microservices
Data Design for Microservices
 
What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017What's New in Serverless - SRV305 - re:Invent 2017
What's New in Serverless - SRV305 - re:Invent 2017
 
How to Build Scalable Serverless Applications
How to Build Scalable Serverless ApplicationsHow to Build Scalable Serverless Applications
How to Build Scalable Serverless Applications
 
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
Monitoring and Troubleshooting in a Serverless World - SRV303 - re:Invent 2017
 
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
Deep Dive into AWS X-Ray: Monitor Modern Applications (DEV324) - AWS re:Inven...
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
 
What's New in Serverless
What's New in ServerlessWhat's New in Serverless
What's New in Serverless
 
From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...
From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...
From Mainframe to Microservices: Vanguard’s Move to the Cloud - ENT331 - re:I...
 
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft BroadridgeAWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
AWS FSI Symposium 2017 NYC - Moving at the Speed of Serverless ft Broadridge
 
規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐規劃大規模遷移到 AWS 的最佳實踐
規劃大規模遷移到 AWS 的最佳實踐
 

Plus de Amazon Web Services

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

Plus de Amazon Web Services (20)

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

A Modern Data Architecture for Microservices

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A Modern Data Architecture for Microservices Blair Layton Business Development Manager Database Services
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What to Expect from the Session • Microservices at AWS • Overview and Challenges • Key Elements and Benefits • Two Pizza Teams • Data Architecture Challenges • Transactions and Rollbacks • Streams • Master Data Management • Choosing a Data Store • Aggregation
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Microservices at AWS
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Microservices at AWS Service-Oriented Architecture (SOA) Single-purpose Connect only through APIs Connect over HTTPS “Microservices”
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Monolithic vs. SOA vs. Microservices Microservices: Many very small components Business logic lives inside of single service domain Simple wire protocols(HTTP with XML/JSON) API driven with SDKs/Clients SOA: Fewer more sophisticated components Business logic can live across domains Enterprise Service Bus like layers between services Middleware
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Monolithic vs. SOA vs. Microservices SOA Coarse-grained Microservices Fine-grained Monolithic Single Unit
  • 7. © 2017, 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
  • 8. © 2017, 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
  • 9. © 2017, 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
  • 10. © 2017, 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
  • 11. © 2017, 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
  • 12. © 2017, 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
  • 13. © 2017, 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)
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Data Architecture Challenges
  • 15. © 2017, 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
  • 16. © 2017, 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
  • 17. © 2017, 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
  • 18. © 2017, 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?
  • 19. © 2017, 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”
  • 20. © 2017, 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)
  • 21. © 2017, 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
  • 22. © 2017, 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
  • 23. © 2017, 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)
  • 24. © 2017, 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
  • 25. © 2017, 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
  • 26. © 2017, 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 Cloudwatch Event to schedule the function (e.g. hourly basis)
  • 27. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Choosing a Datastore
  • 28. © 2017, 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
  • 29. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Service
  • 30. © 2017, 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
  • 31. © 2017, 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.
  • 32. © 2017, 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.8 (EBS) 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
  • 33. © 2017, 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
  • 34. © 2017, 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, or use a composite service (anti-pattern).
  • 35. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aggregation usr svc Pull model Data Aggregation Application account svc cart svc Pull
  • 36. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Aggregation usr svc Pull model Push model Data Aggregation Application account svc cart svc usr svc account svc cart svc Data Aggregation Application Push Pull
  • 37. © 2017, 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 account svc cart svc account svc cart svc Pub Sub usr svc account svc cart svc Data Aggregation Application Push Pull
  • 38. © 2017, 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
  • 39. © 2017, 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
  • 40. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Learn from our Customers
  • 41. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank You for Attending the Webinar We hope you found it interesting! A kind reminder to complete the survey. Let us know what you thought of today’s event and how we can improve the event experience for you in the future. aws-apac-marketing@amazon.com twitter.com/AWSCloud facbook.com/AmazonWebServices youtube.com/user/AmazonWebServices slideshare.net/AmazonWebServices twitch.tv/aws
  • 42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. New to AWS Introductory labs and videos can help you ramp up Start learning Take a Class Build technical skills and learn best practices from an accredited instructor Find a class AWS Certification Validate knowledge and show expertise with industry recognized certifications Get Certified Online Labs Take an online Self-Paced Lab to get hands-on- practice with AWS services Start practicing Learn more: aws.amazon.com/training