SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Message-Driven Architecture
I © NETFORMIC GmbH I
@afoeder
2
Adrian (Föder)
I © NETFORMIC GmbH I20
I © NETFORMIC GmbH I21
“Blocking”.
I © NETFORMIC GmbH I22 Bild: Starbucks
I © NETFORMIC GmbH I23
Blocking Coffee Delivery
Bild: Adrian Föder
I © NETFORMIC GmbH I25
Non-Blocking Coffee Delivery
Bild: http://www.starbucks.ph/about-us/careers/retail-careers.html
I © NETFORMIC GmbH I26
Messaging FTW Non-Blocking Coffee Delivery
Bild: https://pixabay.com/en/starbucks-coffee-spelling-694878/
I © NETFORMIC GmbH I27
Messaging FTW
Queue
Non-Blocking Coffee Delivery
I © NETFORMIC GmbH I28
Messaging FTW Non-Blocking Coffee Delivery
Bild: https://www.supermarktblog.com/2017/11/13/antippen-statt-anstellen-
wie-vapiano-und-mcdonalds-den-bestellprozess-im-schnellrestaurant-
umkrempeln/
I © NETFORMIC GmbH I29
Messages
=
Commands
=
Prozeduraufrufe
I © NETFORMIC GmbH I30
I © NETFORMIC GmbH I31 Bild: Adrian Föder
I © NETFORMIC GmbH I
Domain-Events
32
InvoiceBilled
OrderPlaced
UserRegistered
Registration
Confirmed
Article
Recommended
OrderShipped
ParcelLost
Introducing
I © NETFORMIC GmbH I33 Bild: https://medium.com/jugthde/domain-driven-design-renaissance-event-storming-a193db8ef887
Event Storming
I © NETFORMIC GmbH I34
Shipping
Invoicing
Inventory
Forum
Newsletter
IdentityAccess
MessageBus
UserRegistered
ProductRated
RecipientSubs
cribed
InvoicePaid
ParcelDelivered
ArticlePushed
FromRack
I © NETFORMIC GmbH I35
Domains, Subdomains
und Bounded Contexts
Bild: https://commons.wikimedia.org/wiki/File:ThirdageMiddle-earth.jpg
Domain Model
≠
Domain
Nicht die ganze Welt modellieren.
Bild: Internet halt: nicht mehr eindeutig zuzuordnen
Quasi jede Domain
hat mehrere Subdomains.
• Product Catalog
Orders
Invoicing
Shipping
Bild: Implementing Domain-Driven Design, Vaughn Vernon, p 45
Jeder Bounded Context kann
eine unterschiedliche
Ubiquitous Language haben
Beispiel: „flight“:
• Abheben -> Landen
• Startflugplatz -> Zielflugplatz
• Logbuch Captain
• Flugzeugwartung
Beispiel nach [Fowler]:
Bild: https://martinfowler.com/bliki/BoundedContext.html
I © NETFORMIC GmbH I45
Integrating Bounded Contexts
I © NETFORMIC GmbH I46
Shipping
Invoicing
Inventory
Forum
Newsletter
IdentityAccess
MessageBus
UserRegistered
ProductRated
RecipientSubs
cribed
InvoicePaid
ParcelDelivered
ArticlePushed
FromRack
I © NETFORMIC GmbH I47
Bild: Implementing Domain-Driven Design, Vaughn Vernon, p 287
I © NETFORMIC GmbH I48
I © NETFORMIC GmbH I49
I © NETFORMIC GmbH I50
Event-Sourcing
I © NETFORMIC GmbH I51
Klassische Persistenz
Aktuellen Stand speichern
I © NETFORMIC GmbH I52
Event Sourcing:
Chronologisch alles speichern,
was passiert.
I © NETFORMIC GmbH I53
Customer
newCustomer(John,RubyLane12)
CustomerCreatedEvent(…)
Event Store
I © NETFORMIC GmbH I54
Customer
$customer->move(BakerSt221b)
CustomerCreatedEvent(…)
CustomerMovedEvent(…)
Event Store
I © NETFORMIC GmbH I55
Customer
CustomerCreatedEvent(…)
CustomerMovedEvent(…)
CustomerUpgradedEvent(…)
Event Store
$customer->upgradeTo(Customer::PREMIUM)
I © NETFORMIC GmbH I56
Wiederherstellen
I © NETFORMIC GmbH I57
Customer
name: John
address: Ruby Lane
customerType: Customer::REGULAR
2017-02-08T13:40:03 CustomerCreatedEvent(John, Ruby Lane 12)
I © NETFORMIC GmbH I58
Customer
name: John
address: Baker St 221b
customerType: Customer::REGULAR
2017-02-08T13:40:03 CustomerCreatedEvent(John, Ruby Lane 12)
2018-01-07T09:47:28 CustomerMovedEvent(Baker St 221b)
I © NETFORMIC GmbH I59
Customer
name: John
address: Baker St 221b
customerType: Customer::PREMIUM
2017-02-08T13:40:03 CustomerCreatedEvent(John, Ruby Lane 12)
2018-01-07T09:47:28 CustomerMovedEvent(Baker St 221b)
2018-01-14T05:18:01 CustomerUpgradedTo(Customer::PREMIUM)
I © NETFORMIC GmbH I60
I © NETFORMIC GmbH I61
I © NETFORMIC GmbH I62
Reservation
Placed
Reservation
ReadyForPickupReservation
Read
Reservation
PickedUp
I © NETFORMIC GmbH I63
Shipping
Invoicing
Inventory
Forum
Newsletter
IdentityAccess
MessageBus
Event
-Store
I © NETFORMIC GmbH I64
Domain Events:
Event Sourcing
(beinahe) for free
I © NETFORMIC GmbH I65
Reservation
Printed
Reservation
PickedUp
I © NETFORMIC GmbH I66
„Der Apotheker
soll per Browser-
Push über neue
Reservierungen
benachrichtigt
werden.“
I © NETFORMIC GmbH I67
I © NETFORMIC GmbH I68
I © NETFORMIC GmbH I69
I © NETFORMIC GmbH I70
Stand 24.09.2018:
(seit Start Juni 2017)
I © NETFORMIC GmbH I
Implementierung und Libraries
71
I © NETFORMIC GmbH I72
Bild: https://twitter.com/afoeder/status/670549546905280512
I © NETFORMIC GmbH I73
Bild: https://twitter.com/afoeder/status/670566256790126592
I © NETFORMIC GmbH I74
…aber dann kam prooph.
I © NETFORMIC GmbH I75
Bild: Screenshot http://getprooph.org/
I © NETFORMIC GmbH I76
Bild: aus https://prolic.github.io/cqrs-event-sourcing-talk-php-meetup-wellington/#/42 entnommen
I © NETFORMIC GmbH I77
Bild: Screenshots aus https://www.sasaprolic.com/2018/08/the-future-of-prooph-components.html
I © NETFORMIC GmbH I
Etwas mehr Technik?
78
Bild: John Nebbia, von https://www.irishnews.com/magazine/daily/2018/01/09/news/remembering-bailey-the-i-have-no-idea-what-i-m-doing-dog-1228648/
I © NETFORMIC GmbH I79
Remembering Aggregates
I © NETFORMIC GmbH I80
Aggregates
Aggregate sind eine Gruppierung aus Objekten, die
miteinander in Verbindung stehen
Ein Aggregat hat eine Wurzel und eine Grenze
I © NETFORMIC GmbH I81
Aggregates
I © NETFORMIC GmbH I82
Ein komplettes Aggregate wird Event-gesourct.
I © NETFORMIC GmbH I83
I © NETFORMIC GmbH I84
I © NETFORMIC GmbH I85
I © NETFORMIC GmbH I86
I © NETFORMIC GmbH I87
I © NETFORMIC GmbH I88
I © NETFORMIC GmbH I
Literatur
89
I © NETFORMIC GmbH I90

Weitere ähnliche Inhalte

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Message driven architecture

Hinweis der Redaktion

  1. Deutscher Apotheker Verlag, kurz DAN
  2. Gesundheitsportal; 2x am Tag neue News Hegt und pflegt Apothekendaten von sämtlichen Apos in DE: Inhaberdaten, Öffnungszeiten, Notdienstzeiten
  3. Verkauft und Lizenziert diese Daten und Dienste an Lizenznehmer, darunter auch Tageszeitungen usw —> 3. Unterstützt Apotheken im Online-Marketing via Microsite, aber auch Newsletter, Facebook-Marketing usw
  4. “Clubseite”
  5. Netformic Übernahme 2014: Haben ein recht altes System übernommen
  6. (Jahreszahl; complaints von IDE rechts) Aufgabe von NF: dieses System zunächst zu erhalten, aber auch…
  7. Weil das alles so ein Durcheinander ist, die vertraulichen Daten per Fax und E-Mail durch die Gegend verschickt wurden und das alles geordneter ablaufen sollte:
  8. Netzwerklatenz Mal früher, mal später, Generell outage
  9. Während des Bezahlens wird der Kaffee, oder auch nicht, schon zubereitet Ihr wisst, dass ihr Warten müsst Das Prinzip SKALIERT gut: je nach Engpass kann mehr in Betrieb genommen werden Das System ist RESILIENT: wenn der Barista umfällt … weitermachen wo aufgehört oder neuer Barista in betrieb genommen
  10. Während des Bezahlens wird der Kaffee, oder auch nicht, schon zubereitet Ihr wisst, dass ihr Warten müsst Das Prinzip SKALIERT gut: je nach Engpass kann mehr in Betrieb genommen werden Das System ist RESILIENT: wenn der Barista umfällt … weitermachen wo aufgehört oder neuer Barista in betrieb genommen
  11. Domain Events: Dinge, die in der (gesamten) Domain, Kontextübergreifend, passieren: InvoiceBilled, OrderPlaced, UserRegistered, RegistrationConfirmed, ArticleRecommended, OrderShipped, ParcelLost (Event-Storming: bei unbekannter Domain alle Beteiligten in einen Raum sperren, mit Post-Its ausstatten und aufschreiben lassen, was _passiert_) Domain-Events
  12. Domain: was eine Organisation tut und die Welt, in der sie es tut
  13. Anstatt den Gesamtzustand des Einkaufswagens immer wieder zu “verändern”, wird einfach immer gespeichert, was der Einläufer zu welchem Zeitpunkt in den Warenkorb gelegt hat. Bei Bedarf wird dann aus dieser Historie der Gesamtstand ermittelt