From Monolith to Observable Microservices using DDD Maria Gomez - - PowerPoint PPT Presentation

from monolith to observable microservices using ddd
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

From Monolith to Observable Microservices using DDD

Maria Gomez @mariascandella Tech Principal

slide-2
SLIDE 2

...

slide-3
SLIDE 3
slide-4
SLIDE 4
slide-5
SLIDE 5

HOW?

slide-6
SLIDE 6

What is Domain Driven Design?

It is an approach to building software that has complex and ever- changing business requirements

slide-7
SLIDE 7
slide-8
SLIDE 8

Key Concepts

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

slide-9
SLIDE 9

Key Concepts

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

slide-10
SLIDE 10

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

slide-11
SLIDE 11

Sales Catalog Support

slide-12
SLIDE 12

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

slide-13
SLIDE 13

Key Concepts

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

  • r not, thus producing a domain event.

Aggregate

slide-14
SLIDE 14

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

slide-15
SLIDE 15
slide-16
SLIDE 16

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

slide-17
SLIDE 17

What to do when bounded contexts are identified?

  • 1. Isolate them
  • 2. Extract them into services
slide-18
SLIDE 18

Bounded Context

High Cohesion Loose Coupling Represents Business Capability Individual Tech Stacks & Persistence Deploy independently Isolate Failure Individual Scalability

Microservices

+ =

slide-19
SLIDE 19

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

slide-20
SLIDE 20

Where to start?

  • Pace of change
  • Performance
  • Security
  • Team structure
  • Dependencies (internal or external)
  • Technology

Identify Business Value

slide-21
SLIDE 21

Warner Bros. [Public domain]

slide-22
SLIDE 22

But, wait… We’re not done yet!

slide-23
SLIDE 23

Iceberg by Oleksandr Panasovskyi from the Noun Project

What to extract Testing Deployment Operations Security

slide-24
SLIDE 24

Observability

slide-25
SLIDE 25

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

slide-26
SLIDE 26

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

slide-27
SLIDE 27

Collector Monitoring Query UI

Transform

Logging

slide-28
SLIDE 28

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” …. …. }

slide-29
SLIDE 29

Monitoring

  • 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.

Allows you to make informed decisions

slide-30
SLIDE 30

Semantic Monitoring

slide-31
SLIDE 31
slide-32
SLIDE 32

Monitoring Overload!

slide-33
SLIDE 33

Alerting

  • Alerts should be actionable

Things that need immediate reaction

slide-34
SLIDE 34

Alerting

  • Alerts should be actionable
  • Not all alerts need a human. Leverage automation!

Things that need immediate reaction

slide-35
SLIDE 35

Tracing

Useful for debugging POST /pay

TraceId TraceId TraceId TraceId

slide-36
SLIDE 36

Tracing

Useful for debugging POST /pay

TraceId TraceId TraceId TraceId

Tracing system

slide-37
SLIDE 37

Take Away

  • 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)

Microservices is really not a free lunch!

slide-38
SLIDE 38

Thanks!

Maria Gomez @mariascandella