From Monolith to Observable Microservices using DDD
Maria Gomez @mariascandella Tech Principal
From Monolith to Observable Microservices using DDD Maria Gomez - - PowerPoint PPT Presentation
From Monolith to Observable Microservices using DDD Maria Gomez @mariascandella Tech Principal ... HOW? What is Domain Driven Design? It is an approach to building software that has complex and ever- changing business requirements Key
Maria Gomez @mariascandella Tech Principal
It is an approach to building software that has complex and ever- changing business requirements
A sphere of knowledge, influence, or activity. What an organisation does, and the world it does it in.
Domain
A system of abstractions describing selected aspects of a Domain. It is used to solve problems related to that Domain
Subdomains
A Language structured around the Subdomain and used by all team members.
Ubiquitous Language
An explicit boundary within which a Subdomain exists. Inside, all terms have a specific meaning and are part of the Ubiquitous Language
Bounded Context
https://martinfowler.com/bliki/BoundedContext.html
Sales Catalog Support
Event Storming is a workshop format for quickly exploring complex business domains.
http://ziobrando.blogspot.com/2013/11/introducing-event-storming.html By Henning Schwentner - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=57766348
Something happened, of interest to a domain expert
Domain Event
An external instruction to do something. It triggers a Domain Event.
Command
The portion of the system that receives commands and decides whether to execute them
Aggregate
Ticket sent by email Payment confirmed Ticket bought Order created Ticket added to cart Seat reserved Show selected Choose show Choose seat Add ticket to cart
Move to checkout Insert checkout data Process payment Buyer
Accountant
Customer Service
Order confirmation sent by email
Payment confirmed Order held Delivery Method added Promo added to Order Order modified Order created
Move to checkout
Add / Remove Articles Use Promo code
Select Delivery Method Insert checkout data Process payment
Promotion
Accountant
Customer Service
Delivery Address Order
Bounded Context
High Cohesion Loose Coupling Represents Business Capability Individual Tech Stacks & Persistence Deploy independently Isolate Failure Individual Scalability
Microservices
Order confirmation sent by email
Payment confirmed Order held Delivery Method added Promo added to Order Order modified Order created
Move to checkout
Add / Remove Articles Use Promo code
Select Delivery Method Insert checkout data Process payment
Promotion
Accountant
Customer Service
Delivery Address Order
Warner Bros. [Public domain]
Iceberg by Oleksandr Panasovskyi from the Noun Project
What to extract Testing Deployment Operations Security
Tracing Monitoring Alerts Logging
No Logs by Sweet Farm from the Noun Project Alert by ✦ Shmidt Sergey ✦ from the Noun Project traceability by Timofey Rostilov from the Noun Project
Collector Monitoring Query UI
Transform
{ CreationTime: “2017-02-24T17:49:15”, Id: “9fe0650565-3dac-425a-c83e38499c”, Host: “WEBSRVR06”, ServiceId: “MyShoppingCartService”, ComponentId: “DynamoDBWriter”, Message: “Body size exceeded 400kb limit” …. …. }
Allows you to make informed decisions
Semantic Monitoring
Things that need immediate reaction
Things that need immediate reaction
Useful for debugging POST /pay
TraceId TraceId TraceId TraceId
Useful for debugging POST /pay
TraceId TraceId TraceId TraceId
Tracing system
○
Be intentional about things you log, monitor, and alert on
○
Proactively iterate and eliminate noise
○
Evaluate and use existing tools and libraries (ELK stack, OpenTracing, Honeycomb, Datadog, Opsgenie, etc)
Microservices is really not a free lunch!
Maria Gomez @mariascandella