SlideShare a Scribd company logo
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Essential Capabilities behind
Microservices
Kim Kao
Solutions Architect
Amazon Web Services
D e v D a y - 2
Domain Driven Design(DDD Taiwan)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
The new normal: companies are increasingly
global and products are increasingly digital
47%
of CEOs said they are
being challenged by
the board of directors
to make progress in
digital business
Source: Gartner
79%
of CIOs believe that
digital business is
making their IT
organizations better
prepared to change
67%
of all business leaders
believe that they must
pick up the pace of
digitalization to
remain competitive
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Why are enterprises
adopting microservices?
• Accelerate software development
• Build modern applications
• Automate operations at web scale
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
To maintain competitive advantage, digital
businesses must innovate as rapidly as possible
FeedbackIdeas
Experiment
Innovation
Flywheel
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Manager -
“We are going to run workload(s) on AWS.
We have new sub-systems/module to develop with legacy services.
Container is good, Lambda is awesome. It’s great to have whole cloud native
advantage
if you guys migrate all service into microservice, serverless...”
Developer(s) - “Not a problem. I’ll make it …”
A typical day for customer ...
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Jump into real world...
https://vaughnvernon.co/tag/event-storming/
(Earn money as usual) (will it run as usual?)
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
When the impact of change is small,
release velocity can increase
Monolith
Does everything
Microservices
Do one thing
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
100/200/300/1000?
LOC
Code matters?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
AWS FargateAmazon Elastic
Container Service
Amazon Elastic
Container Service for
Kubernetes
Docker
Containers is Microservices?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Domain Driven Design
Fit in
• Standalone computing & persistence
• Serve for specific business intentions
• Business Capability in bounded Context
• Embrace Rapidly Change
• Automate operations at web scale
• Engineering Decoupling
Microservices stand for ...
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Mobile client
Client
IoT
Computing in variety platform
API
Gateway
Account DB
Shipping DB
Inventory DB
Store Front
Web App
Shipment
Query
Inventory
Query
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Relational
Referential
integrity, ACID
transactions,
schema-
on-write
Lift and shift, ERP,
CRM, finance
Key-value
High
throughput, low-
latency reads
and writes,
endless scale
Real-time bidding,
shopping cart,
social, product
catalog, customer
preferences
Document
Store
documents and
quickly access
querying on
any attribute
Content
management,
personalization,
mobile
In-memory
Query by key
with
microsecond
latency
Leaderboards,
real-time analytics,
caching
Graph
Quickly and
easily create
and navigate
relationships
between
data
Fraud detection,
social networking,
recommendation
engine
Time-series
Collect, store,
and process
data sequenced
by time
IoT applications,
event tracking
Ledger
Complete,
immutable, and
verifiable history
of all changes to
application data
Systems
of record, supply
chain, health care,
registrations,
financial
Amazon
QLDB
Amazon Aurora
Amazon RDS
Amazon
DynamoDB
Amazon
DocumentDB
Amazon
ElastiCache
Amazon
Neptune
Amazon
Timestream
Choose right one to support Microservices
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Challenges
(dealing with transaction, service lookup)
(priority, customer expectation)
(by noun, organization, experience?)
(CRM, ERP, Payment Gateway ...)
(self employee, out sourcing, ISV)
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(priority, market expectation)
Domain
Expert
Matters
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Strategies for Dealing with Legacy Systems
• Bubble Context
• Place your new functionality in a bubble and have repositories as an anti-corruption
layer(ACL) toward the legacy code and data.
• Autonomous Bubble
• Start a new chapter OUTSIDE the legacy code with its own storage. Thus we need to
synchronize ACL and similar information that you shares with the legacy system
• Open Host Services in Published Language
• Expose legacy assets through an open host service. Using an anti-corruption layer to convert
the necessary information to the new system
• Event Streams
• The systems communicate trough events. The anti-corruption layer now publishes the event
and monitor the state of the other system. The solution is similar to event sourcing.
(priority, customer expectation)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(dealing with transaction, service lookup)
Monolith
Does everything
Per Service
Do only one thing
Business matters
Immutable facts
- Order Created
- Coupon applied
- Account Registered
Intention
Business behavior
- Create an Order
- Apply Coupon
- Register an Account
Responsible for
Capabilities
- Order
- Discount
- Identity Management
Accept
&
process
Presentation Model
Help to make decision
Composite data type
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(dealing with transaction, service lookup)
Monolith
Does everything
Per Service
Do only one thing
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• Microservices candidate – Bounded Context
• Per Bounded Context form up system Boundary
• One Bounded Context may
• Contains multiple co-related Aggregates
• Or only one Aggregate with Specific business capability
(dealing with transaction, service lookup)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
DevicesDB
External
Interfaces UI
WebControllers
Use Cases
Entities
Gatew
ays
Presenters
QLDBRDS
SNS, SQS, SMS
Messaging
UI
S3
Static page
ELB ingress
Use Cases
Entity
(Aggregate)
APIGatew
ay
Quicksight
Blockchain
Tim
e DB
Aggregate
Dynamodb
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(dealing with transaction, service lookup)
Observability & traffic control
Easily export logs, metrics, and traces
Client side traffic policies—circuit breaking, retries
Routes for deployments
Works across clusters and container services
Amazon ECS
Amazon EKS
Kubernetes on EC2
AWS Fargate
AWS built and run
No control plane to manage
Ease of operations
High scale
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(dealing with transaction, service lookup)
• Are you ready to deal with M:N transaction compensation ?
• Are you ready to embrace the rapidly change by contract ?
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Transaction Dependencies between Microservices
• Upstream-Downstream co-relationship
• One Transaction invoke local API and Remote API
Book Rental
Service
Book Flight
Service
Trip Service
Book Hotel
Service
Exception / Error ?
Exception / Error ?
Exception / Error ?
!"
#
!$
#
!#
#
+
+
Transaction Compensate
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Saga : Alternative for 2 Phase -commit
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Context
• You have applied the Database per Service pattern. Each
service has its own database.
• Some business transactions, however, span multiple service
so you need a mechanism to ensure data consistency
across services.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Solutions
• Each local transaction updates self and
publishes a message/event to trigger the
next local transaction in the saga.
• If a local transaction fails because it
violates a business rule then the saga
executes a series of compensating
transactions that undo the changes that
were made by the preceding local
transactions.
https://microservices.io/patterns/data/saga.html
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Orchestration-based Saga
• Coordinator stand alone
• Each service provide
a pair function for Success or Fail
• Abstract compensate logic
out of Codes
https://microservices.io/patterns/data/saga.html
1
1.1 2 3
4
5
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Implementing Saga pattern on AWS
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• Each Service provide cancel operation
• State change trigger cancel operation
• Simplify Complexity rules
• Just a JSON file
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Code snippet
https://github.com/humank/lambda-saga-pattern
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Demo
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(by noun, organization, experience?)
(CRM, ERP, Payment Gateway ...)
(self employee, out sourcing, ISV)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• By business Capability
• Form up boundary by Bounded Context
• Clarify Sub Domains
• Core sub domain – (most valuable)
• General sub domain – (facilitate business)
• Support sub domain – (support, infra)
(by noun, organization, experience?)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
(by noun, organization, experience?)
A Team
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• Resources allocation by value chain
• Talents devote to build up core sub domain
• Responsible for general sub domain
• Out sourcing or ISV for support domain
(self employee, out sourcing, ISV)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
ISV/Package
Support sub Domain
Out Sourcing
General Sub Domain
Pay the most efforts on critical business component
Talents developing code
Core Sub Domain
(self employee, out sourcing, ISV)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
• Incrementally breakout dependencies
• Cut-off Database Link
• Do not allow cross schema access permissions
• Define API contract only for data exchange
• Considering to move out store procedure into application
code
• Leave the legacy system as a data container
(CRM, ERP, Payment Gateway ...)
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
When you should dive in Microservices
Team
Partners
Business
Operation
Coding
Value
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Migration from Monolith to Microservices
via DDD approach readiness
https://github.com/humank/microservices
Update soon !
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Implementing DDD on AWS
Community : DDD Taiwan@FB
Telegram : YikaiKao
WeChat : YikaiKao
Twitter : @YikaiKao
GitHub Repos
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Take Away
Know Why/What/How
• Do you really need Microservices?
• Leverage Business Events to aggregate context
and form up Service Boundary
• There is no C4 to solve distributed persistence
issue
• State Machine to do Transaction Compensate
(Step Functions way to go)
• DDD is good to collaborate Business and
Technology guys by speaking Ubiquitous
Language
• Crunch Problem, then design solution
Thank you!
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

More Related Content

PPT
Domain Driven Design (DDD)
PPTX
Domain Driven Design(DDD) Presentation
PPTX
Domain Driven Design
PDF
Serverless時代のJavaについて
PDF
マイクロサービス化に向けて
PPTX
DX実践!~ビジネスアジリティ向上とマイクロサービス技術GraphQLの活用~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
PDF
Domain Driven Design (Ultra) Distilled
PDF
Case Study: How to move from a Monolith to Cloud, Containers and Microservices
Domain Driven Design (DDD)
Domain Driven Design(DDD) Presentation
Domain Driven Design
Serverless時代のJavaについて
マイクロサービス化に向けて
DX実践!~ビジネスアジリティ向上とマイクロサービス技術GraphQLの活用~(NTTデータ テクノロジーカンファレンス 2020 発表資料)
Domain Driven Design (Ultra) Distilled
Case Study: How to move from a Monolith to Cloud, Containers and Microservices

What's hot (20)

PPSX
Microservices Docker Kubernetes Istio Kanban DevOps SRE
PDF
03_AWS IoTのDRを考える
PPTX
[社内勉強会]ELBとALBと数万スパイク負荷テスト
PDF
Dockercon State of the Art in Microservices
PDF
WebSocketのキホン
PDF
リクルートのWebサービスを支える「RAFTEL」
PDF
[AKIBA.AWS] VPCをネットワーク図で理解してみる
PDF
Cloud Migration 과 Modernization 을 위한 30가지 아이디어-박기흥, AWS Migrations Specialist...
PDF
CloudFrontのリアルタイムログをKibanaで可視化しよう
PDF
Swagger ではない OpenAPI Specification 3.0 による API サーバー開発
PDF
DevOps with Database on AWS
PDF
それはYAGNIか? それとも思考停止か?
PDF
20190723 AWS Black Belt Online Seminar AWS CloudHSM
PDF
Apache Kafka 0.11 の Exactly Once Semantics
PDF
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
PDF
20190604 AWS Black Belt Online Seminar Amazon Simple Notification Service (SNS)
PDF
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
PDF
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
PDF
SHOWROOMとDeNAで取り組んだライブ配信基盤刷新・超低遅延ライブ配信の裏側【DeNA TechCon 2020 ライブ配信】
PDF
KubernetesでRedisを使うときの選択肢
Microservices Docker Kubernetes Istio Kanban DevOps SRE
03_AWS IoTのDRを考える
[社内勉強会]ELBとALBと数万スパイク負荷テスト
Dockercon State of the Art in Microservices
WebSocketのキホン
リクルートのWebサービスを支える「RAFTEL」
[AKIBA.AWS] VPCをネットワーク図で理解してみる
Cloud Migration 과 Modernization 을 위한 30가지 아이디어-박기흥, AWS Migrations Specialist...
CloudFrontのリアルタイムログをKibanaで可視化しよう
Swagger ではない OpenAPI Specification 3.0 による API サーバー開発
DevOps with Database on AWS
それはYAGNIか? それとも思考停止か?
20190723 AWS Black Belt Online Seminar AWS CloudHSM
Apache Kafka 0.11 の Exactly Once Semantics
Implementing Domain-Driven Design (Study Group) Chapter 3 - Context Maps
20190604 AWS Black Belt Online Seminar Amazon Simple Notification Service (SNS)
IAM Roles Anywhereのない世界とある世界(2022年のAWSアップデートを振り返ろう ~Season 4~ 発表資料)
ホットペッパービューティーにおけるモバイルアプリ向けAPIのBFF/Backend分割
SHOWROOMとDeNAで取り組んだライブ配信基盤刷新・超低遅延ライブ配信の裏側【DeNA TechCon 2020 ライブ配信】
KubernetesでRedisを使うときの選択肢
Ad

Similar to 2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices (20)

PDF
Microservices and Data Design
PDF
AWS Summit Singapore 2019 | Operating Microservices at Hyperscale
PDF
2019 03-13-implementing microservices by ddd
PPTX
Tools for building your MVP on AWS
PDF
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
PDF
Scaling to Billions of IoT Devices with MindSphere on AWS
PDF
AWS Summit Singapore 2019 | AWS Techfest Opening Keynote
PDF
2019 03-23-2nd-meetup-essential capabilities behind microservices
PPTX
Data Design and Modeling for Microservices I AWS Dev Day 2018
PDF
AWS Summit Seoul 2015 - AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
PPTX
DevConZM - Modern Applications Development in the Cloud
PDF
AWS Startup Day Santiago - Tools For Building Your Startup
PPTX
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
PPTX
AWS Accra Meetup - Developing Modern Applications in the Cloud
PPTX
AWS Jozi Meetup Developing Modern Applications in the Cloud
PDF
AWS Startup Day Bogotá - Tools for Building Your Startup
PDF
Scalable Microservices at Netflix. Challenges and Tools of the Trade
PDF
2019 04-25-agile communitymeetup-essentialcapabilitiesbehindmicroservices
PDF
2019 04-25-agile communitymeetup-essentialcapabilitiesbehindmicroservices
PPTX
DevOps: The Amazon Way
Microservices and Data Design
AWS Summit Singapore 2019 | Operating Microservices at Hyperscale
2019 03-13-implementing microservices by ddd
Tools for building your MVP on AWS
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Scaling to Billions of IoT Devices with MindSphere on AWS
AWS Summit Singapore 2019 | AWS Techfest Opening Keynote
2019 03-23-2nd-meetup-essential capabilities behind microservices
Data Design and Modeling for Microservices I AWS Dev Day 2018
AWS Summit Seoul 2015 - AWS 최신 서비스 살펴보기 - Aurora, Lambda, EFS, Machine Learn...
DevConZM - Modern Applications Development in the Cloud
AWS Startup Day Santiago - Tools For Building Your Startup
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Startup Day Bogotá - Tools for Building Your Startup
Scalable Microservices at Netflix. Challenges and Tools of the Trade
2019 04-25-agile communitymeetup-essentialcapabilitiesbehindmicroservices
2019 04-25-agile communitymeetup-essentialcapabilitiesbehindmicroservices
DevOps: The Amazon Way
Ad

More from Kim Kao (10)

PDF
Enlarge influence by Participating in communities
PDF
2019 08-01-i ddd-studygroup-appendix
PDF
跟著Actor Model來一場與DDD的豔遇
PDF
Ddd by-clark chou
PDF
My past-3 yeas-developer-journey-at-linkedin-by-iantsai
PDF
Ddd(meetup 2) ddd with clean architecture
PDF
2019-02-20-ddd taiwan-community-iddd-studygroup-1st
PDF
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
PDF
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
PDF
Legacy java ee meet lambda
Enlarge influence by Participating in communities
2019 08-01-i ddd-studygroup-appendix
跟著Actor Model來一場與DDD的豔遇
Ddd by-clark chou
My past-3 yeas-developer-journey-at-linkedin-by-iantsai
Ddd(meetup 2) ddd with clean architecture
2019-02-20-ddd taiwan-community-iddd-studygroup-1st
DDD Taiwan Community 2019 01-26-1st-meetup-why ddd matters
2018 10-19-jc conf-embrace-legacy-java-ee-by-aws-serverless
Legacy java ee meet lambda

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
AI in Product Development-omnex systems
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
medical staffing services at VALiNTRY
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
ai tools demonstartion for schools and inter college
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
Introduction to Artificial Intelligence
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms II-SECS-1021-03
2025 Textile ERP Trends: SAP, Odoo & Oracle
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms I-SECS-1021-03
Adobe Illustrator 28.6 Crack My Vision of Vector Design
AI in Product Development-omnex systems
wealthsignaloriginal-com-DS-text-... (1).pdf
Reimagine Home Health with the Power of Agentic AI​
medical staffing services at VALiNTRY
How to Choose the Right IT Partner for Your Business in Malaysia
ai tools demonstartion for schools and inter college
VVF-Customer-Presentation2025-Ver1.9.pptx
Operating system designcfffgfgggggggvggggggggg
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Softaken Excel to vCard Converter Software.pdf
Introduction to Artificial Intelligence

2019 06-12-aws taipei summit-dev day-essential capabilities behind microservices

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Essential Capabilities behind Microservices Kim Kao Solutions Architect Amazon Web Services D e v D a y - 2 Domain Driven Design(DDD Taiwan)
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T The new normal: companies are increasingly global and products are increasingly digital 47% of CEOs said they are being challenged by the board of directors to make progress in digital business Source: Gartner 79% of CIOs believe that digital business is making their IT organizations better prepared to change 67% of all business leaders believe that they must pick up the pace of digitalization to remain competitive
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Why are enterprises adopting microservices? • Accelerate software development • Build modern applications • Automate operations at web scale © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T To maintain competitive advantage, digital businesses must innovate as rapidly as possible FeedbackIdeas Experiment Innovation Flywheel
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Manager - “We are going to run workload(s) on AWS. We have new sub-systems/module to develop with legacy services. Container is good, Lambda is awesome. It’s great to have whole cloud native advantage if you guys migrate all service into microservice, serverless...” Developer(s) - “Not a problem. I’ll make it …” A typical day for customer ...
  • 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Jump into real world... https://vaughnvernon.co/tag/event-storming/ (Earn money as usual) (will it run as usual?)
  • 7. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T When the impact of change is small, release velocity can increase Monolith Does everything Microservices Do one thing
  • 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T 100/200/300/1000? LOC Code matters?
  • 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T AWS FargateAmazon Elastic Container Service Amazon Elastic Container Service for Kubernetes Docker Containers is Microservices?
  • 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Domain Driven Design Fit in • Standalone computing & persistence • Serve for specific business intentions • Business Capability in bounded Context • Embrace Rapidly Change • Automate operations at web scale • Engineering Decoupling Microservices stand for ...
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Mobile client Client IoT Computing in variety platform API Gateway Account DB Shipping DB Inventory DB Store Front Web App Shipment Query Inventory Query
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Relational Referential integrity, ACID transactions, schema- on-write Lift and shift, ERP, CRM, finance Key-value High throughput, low- latency reads and writes, endless scale Real-time bidding, shopping cart, social, product catalog, customer preferences Document Store documents and quickly access querying on any attribute Content management, personalization, mobile In-memory Query by key with microsecond latency Leaderboards, real-time analytics, caching Graph Quickly and easily create and navigate relationships between data Fraud detection, social networking, recommendation engine Time-series Collect, store, and process data sequenced by time IoT applications, event tracking Ledger Complete, immutable, and verifiable history of all changes to application data Systems of record, supply chain, health care, registrations, financial Amazon QLDB Amazon Aurora Amazon RDS Amazon DynamoDB Amazon DocumentDB Amazon ElastiCache Amazon Neptune Amazon Timestream Choose right one to support Microservices
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Challenges (dealing with transaction, service lookup) (priority, customer expectation) (by noun, organization, experience?) (CRM, ERP, Payment Gateway ...) (self employee, out sourcing, ISV)
  • 15. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (priority, market expectation) Domain Expert Matters
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Strategies for Dealing with Legacy Systems • Bubble Context • Place your new functionality in a bubble and have repositories as an anti-corruption layer(ACL) toward the legacy code and data. • Autonomous Bubble • Start a new chapter OUTSIDE the legacy code with its own storage. Thus we need to synchronize ACL and similar information that you shares with the legacy system • Open Host Services in Published Language • Expose legacy assets through an open host service. Using an anti-corruption layer to convert the necessary information to the new system • Event Streams • The systems communicate trough events. The anti-corruption layer now publishes the event and monitor the state of the other system. The solution is similar to event sourcing. (priority, customer expectation)
  • 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (dealing with transaction, service lookup) Monolith Does everything Per Service Do only one thing Business matters Immutable facts - Order Created - Coupon applied - Account Registered Intention Business behavior - Create an Order - Apply Coupon - Register an Account Responsible for Capabilities - Order - Discount - Identity Management Accept & process Presentation Model Help to make decision Composite data type
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (dealing with transaction, service lookup) Monolith Does everything Per Service Do only one thing
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • Microservices candidate – Bounded Context • Per Bounded Context form up system Boundary • One Bounded Context may • Contains multiple co-related Aggregates • Or only one Aggregate with Specific business capability (dealing with transaction, service lookup)
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
  • 23. QLDBRDS SNS, SQS, SMS Messaging UI S3 Static page ELB ingress Use Cases Entity (Aggregate) APIGatew ay Quicksight Blockchain Tim e DB Aggregate Dynamodb
  • 24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (dealing with transaction, service lookup) Observability & traffic control Easily export logs, metrics, and traces Client side traffic policies—circuit breaking, retries Routes for deployments Works across clusters and container services Amazon ECS Amazon EKS Kubernetes on EC2 AWS Fargate AWS built and run No control plane to manage Ease of operations High scale
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (dealing with transaction, service lookup) • Are you ready to deal with M:N transaction compensation ? • Are you ready to embrace the rapidly change by contract ?
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Transaction Dependencies between Microservices • Upstream-Downstream co-relationship • One Transaction invoke local API and Remote API Book Rental Service Book Flight Service Trip Service Book Hotel Service Exception / Error ? Exception / Error ? Exception / Error ? !" # !$ # !# # + + Transaction Compensate
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Saga : Alternative for 2 Phase -commit
  • 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Context • You have applied the Database per Service pattern. Each service has its own database. • Some business transactions, however, span multiple service so you need a mechanism to ensure data consistency across services.
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Solutions • Each local transaction updates self and publishes a message/event to trigger the next local transaction in the saga. • If a local transaction fails because it violates a business rule then the saga executes a series of compensating transactions that undo the changes that were made by the preceding local transactions. https://microservices.io/patterns/data/saga.html
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Orchestration-based Saga • Coordinator stand alone • Each service provide a pair function for Success or Fail • Abstract compensate logic out of Codes https://microservices.io/patterns/data/saga.html 1 1.1 2 3 4 5
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Implementing Saga pattern on AWS
  • 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • Each Service provide cancel operation • State change trigger cancel operation • Simplify Complexity rules • Just a JSON file
  • 33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Code snippet https://github.com/humank/lambda-saga-pattern
  • 34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Demo
  • 35. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (by noun, organization, experience?) (CRM, ERP, Payment Gateway ...) (self employee, out sourcing, ISV)
  • 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • By business Capability • Form up boundary by Bounded Context • Clarify Sub Domains • Core sub domain – (most valuable) • General sub domain – (facilitate business) • Support sub domain – (support, infra) (by noun, organization, experience?)
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T (by noun, organization, experience?) A Team
  • 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • Resources allocation by value chain • Talents devote to build up core sub domain • Responsible for general sub domain • Out sourcing or ISV for support domain (self employee, out sourcing, ISV)
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T ISV/Package Support sub Domain Out Sourcing General Sub Domain Pay the most efforts on critical business component Talents developing code Core Sub Domain (self employee, out sourcing, ISV)
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T • Incrementally breakout dependencies • Cut-off Database Link • Do not allow cross schema access permissions • Define API contract only for data exchange • Considering to move out store procedure into application code • Leave the legacy system as a data container (CRM, ERP, Payment Gateway ...)
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T When you should dive in Microservices Team Partners Business Operation Coding Value
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Migration from Monolith to Microservices via DDD approach readiness https://github.com/humank/microservices Update soon !
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Implementing DDD on AWS Community : DDD Taiwan@FB Telegram : YikaiKao WeChat : YikaiKao Twitter : @YikaiKao GitHub Repos
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Take Away Know Why/What/How • Do you really need Microservices? • Leverage Business Events to aggregate context and form up Service Boundary • There is no C4 to solve distributed persistence issue • State Machine to do Transaction Compensate (Step Functions way to go) • DDD is good to collaborate Business and Technology guys by speaking Ubiquitous Language • Crunch Problem, then design solution
  • 46. Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.