using the actor model with domain-driven design (ddd) in reactive systems - with vaughn vernon

43
Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems @VaughnVernon Copyright © 2012-2017 for{comprehension} All rights reserved.

Upload: lightbend

Post on 21-Feb-2017

24 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Using the Actor Model withDomain-Driven Design (DDD) in

Reactive Systems

@VaughnVernonCopyright © 2012-2017 for{comprehension} All rights reserved.

Page 2: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

@VaughnVernon

http://VaughnVernon.co

[email protected]

Page 3: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Books

Consulting and Trainingfor{comprehension}

Page 4: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Objects

Page 5: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

1973 - 2003

Page 6: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Cores Matter

More cores, not (much) faster cores

Page 7: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Threading Is Easy!

Page 8: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Threading Is Hard!

Page 9: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Actor Model

Alan Kay: “The big idea is messaging...”

Page 10: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Carl Hewitt, 1973

Page 11: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Jonas Bonér, Akka

Page 12: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Actors AreReactive

Page 13: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Reactive Is

Page 14: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Reactive Is

Page 15: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Reactive Is

Page 16: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Reactive Is

Page 17: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Why the Actor Model Now?

#IoT

Page 18: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Because Cores

88 / 200+ cores with Xeon Phi co-processors

Page 19: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

EmbraceLatency

Page 20: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

MoreWithLess

Page 21: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Direct Asynchronous Messaging

Page 22: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Lock-Free, Share Nothing

Page 23: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Become:Prepare for Next Message

Page 24: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Actor System

Page 25: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Actor Concurrency

Page 26: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

How Many Actors?

50+

100+

1,000,000+

Page 27: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Typical Architecture

Page 28: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Complexity Stack

Page 29: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Simplicity Stack

Page 30: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Inventor of DDD

Page 31: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Essence of DDD

Page 32: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Context Mapping

Page 33: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Responding to RapidNew Business Direction

DDD enables necessaryknowledge crunching

Actors and messages enablesrapid implementation and

clear understanding

Page 34: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Actors and DDD

Alan Kay: “The big idea is messaging...”

Alan Kay: “The Actor model retained moreof what I thought were the good

features of the object idea.”

Page 35: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

UbiquitousLanguageAs Actors and messages...

Page 36: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon
Page 37: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Actor

Command Event

Actor

Command Event

Event StormingTime

Use design-level storming

Page 38: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Aggregates

Transactional Consistency Boundary

Page 39: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Aggregate

● Immutable state object/record

Implementation

● Transition and replace stateupon command

● Emit corresponding event

Page 40: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Reactive Systems

Page 41: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

Read: Designing Reactive Systems With The Actor Model (free O'Reilly book)

Watch: Benefits Of The Actor Model For Cloud Computing: A Pragmatic Overview For Java Architects (co-presented with Forrester Research)

Learn from experts: ask about our Embedded Lightbend Engineer (ELE) forkickstarting your Reactive initiatives

More Resources You May Enjoy…

Page 42: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

MICROSERVICES. FAST DATA PIPELINES. DISTRIBUTED SYSTEMS.

Austin (TX) - October 18-20, 2017

reactivesummit.org

Page 43: Using the Actor Model with Domain-Driven Design (DDD) in Reactive Systems - with Vaughn Vernon

@VaughnVernon

[email protected]

for{comprehension}