from monolith to observable microservices using ddd
play

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


  1. From Monolith to Observable Microservices using DDD Maria Gomez @mariascandella Tech Principal

  2. ...

  3. HOW?

  4. What is Domain Driven Design? It is an approach to building software that has complex and ever- changing business requirements

  5. Key Concepts Domain A sphere of knowledge, in fl uence, or activity. What an organisation does, and the world it does it in. Subdomains A system of abstractions describing selected aspects of a Domain. It is used to solve problems related to that Domain

  6. Key Concepts Ubiquitous Language A Language structured around the Subdomain and used by all team members. Bounded Context An explicit boundary within which a Subdomain exists. Inside, all terms have a speci fi c meaning and are part of the Ubiquitous Language

  7. https://martinfowler.com/bliki/BoundedContext.html

  8. Sales Catalog Support

  9. Event Storming 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

  10. Key Concepts Domain Event Something happened, of interest to a domain expert Command An external instruction to do something. It triggers a Domain Event. Aggregate The portion of the system that receives commands and decides whether to execute them or not, thus producing a domain event.

  11. Choose show Choose Show seat selected Add ticket to Seat cart reserved Ticket Move to added to Accountant checkout cart Insert checkout Order data created Process Ticket Customer payment Buyer bought Service Payment confirmed Ticket sent by email

  12. Move to checkout Add / Order Remove Order Articles created Use Promo Order code modified Promo Select added to Delivery Accountant Method Order Insert Delivery checkout Method data Promotion added Process Order Customer payment Service held Delivery Payment Address confirmed Order confirmation sent by email

  13. What to do when bounded contexts are identified? 1. Isolate them 2. Extract them into services

  14. Bounded Context Individual Tech Stacks & Persistence + Deploy independently = High Cohesion Microservices Isolate Failure Loose Coupling Individual Scalability Represents Business Capability

  15. Move to checkout Add / Order Remove Order Articles created Use Promo Order code modified Promo Select added to Delivery Accountant Method Order Insert Delivery checkout Method data Promotion added Process Order Customer payment Service held Delivery Payment Address confirmed Order confirmation sent by email

  16. Where to start? Pace of change ● Identify Performance ● Business Value Security ● Team structure ● Dependencies (internal or external) ● Technology ●

  17. Warner Bros. [Public domain]

  18. But, wait… We’re not done yet!

  19. What to extract Security Testing Operations Deployment Iceberg by Oleksandr Panasovskyi from the Noun Project

  20. Observability

  21. “Observability is the ability to interrogate your system and get accurate answers that improve your understanding of it”

  22. Logging Alerts Monitoring Tracing 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

  23. Logging Monitoring Transform Collector Query UI

  24. Log Structured Data { CreationTime: “2017-02-24T17:49:15”, Id: “9fe0650565-3dac-425a-c83e38499c”, Host: “WEBSRVR06”, ServiceId: “MyShoppingCartService”, ComponentId: “DynamoDBWriter”, Message: “Body size exceeded 400kb limit” …. …. }

  25. Monitoring Allows you to make informed decisions What’s relevant for each microservice and for the entire system? ● It could be not just single data points but a combination of things. ● Start with something simple and evolve as things get more complicated. ●

  26. Semantic Monitoring

  27. Monitoring Overload!

  28. Alerting Things that need immediate reaction Alerts should be actionable ●

  29. Alerting Things that need immediate reaction Alerts should be actionable ● Not all alerts need a human. Leverage automation! ●

  30. Tracing Useful for debugging TraceId POST /pay TraceId TraceId TraceId

  31. Tracing Useful for debugging Tracing system TraceId POST /pay TraceId TraceId TraceId

  32. Take Away Microservices is really not a free lunch! Start by identifying business domains, DDD can help you on this. ● Don’t wait until having the perfect list of domains, they will change over time. ● Prioritize decoupling based on business value. ● Include operational concerns in your backlog (logging, monitoring, alerting & tracing) ● ○ 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)

  33. Thanks! Maria Gomez @mariascandella

Recommend


More recommend