My talk from Odessa .NET User Group - http://www.usergroup.od.ua/2019/02/microsoft-net-user-group.html
Code can be found here: https://github.com/tamirdresher/FromZeroToTheActorModel
here's nothing new about the actor model, in fact it was invented in the early seventies. So how come its now the hottest buzzword? In this session you will learn what is the Actor Model and why it helps making your system Reactive - scalable, responsive and resilient. You will get to know Akka.Net library that makes the Actor model a piece of cake.
3. 3
Tamir Dresher
• Chief Architect @
• Software Engineering Lecturer @ Ruppin Academic Center
• Book Author
• Rx.NET in Action (Manning)
• Full Stack Web Development with ASP.NET Core
• @tamir_dresher
• http://www.TamirDresher.com
About Me
4. 4
I N T E R N A L & E X T E R N A L C O L L A B O R AT I O N
A U T O M AT E D W O R K F L O W E N G I N E
REPORTS & DASHBOARDS
MOBILE APPS & BOTS
INTEGRATIONS
APPSMARKETPLACE
RESOURCE
MANAGEMENT
TIME &
EXPENSES
FINANCIAL
PLANNING
DEMAND
MANAGEMENT
PROJECT
MANAGEMENT
PORTFOLIO
MANAGEMENT
~2,000 CUSTOMERS IN
124 COUNTRIES
99.95%
UPTIME
ENTERPRISE GRADE
SaaS SOLUTION
FOUNDED IN
2006
CLARIZEN - ENTERPRISE WORK COLLABORATION
5. 5
AGENDA
1. Actor Model
2. Semiconductors
3. Metrology Target Designer
(MTD) by KLA-Tencor
4. Rearchitecting to Actor Model
with Akka.NET
6. 6
The Actor Model (Hewitt et al. 1973)
Alice
Mailbox
Bob
Sally
Mailbox
Mailbox
“the Actor model retained
more of what I thought
were the good features of
the object idea.”
Alan Kay
Object Orientation
pioneer and Smalltalk co-
designer
Alice
Parent
Bob
Parent
Sally
Parent
7. 7
Actors in Akka.NET
7
public class CoordinatorActor : ReceiveActor
{
public CoordinatorActor()
{
Receive<StartSimulation>(start =>
{
//Initiate a new simulation
});
}
}
public class StartSimulation
{
public Guid ProjectId { get; set; }
}
9. 9
Location Transparency (kind of…)
Actors live inside an ActorSystem
Each Actor has a unique address
Local: akka://ActorSystem-A/user/A2
Remote: akka.tcp://ActorSystem-C@Machine-B:5678/user/C1
Machine A Machine B
ActorSystem A
A1
A2
ActorSystem B
B1
B2
ActorSystem C
C1
10. 10
Actor Model → Messaging → Decoupling
Message passing yields decoupling
Interesting messaging patterns are now available
Alice
Sally
Bob
Forwarding
Alice
Sally
Bob
Multiple Responses
11. 11
Metrology Target Design
MTD Case Study
11
https://semiengineering.com/matching-
between-simulations-and-measurements-as-a-
key-driver-for-reliable-overlay-target-design/
12. 12
KLA-Tencor Corporation is a leading
supplier of process control and yield
management solutions for the
semiconductor and related
microelectronics industries
16. 16
MTD Original Architecture
Technology B Services
Technology A ServicesUI Clients
Stack
composer
Material
manager
Simulation
setup
DOE
generator
Geometry
Materials
Simulation
Results
HTTP requests
Notification hubSubscribe →
Notify
Notify
Distribution
Service
Cluster
Outgoing queue
per simulation
Incoming queue
per simulation
Simulation
Coordinator
Technology A
Simulator
Technology B
Simulator
18. 18
Actor Based Architecture - Hierarchy
18
/user
Simulation
Coordinator
Simulation
Queue
Simulation
Notifier
Technology A
Coordinator
Technology A
Simulation
Sub
Simulation 1
Sub
Simulation 2
Sub
Simulation 3
Technology B
Coordinator
Technology B
Simulation
Sub
Simulation 1
Sub
Simulation 2
Sub
Simulation 3
20. 20
Statefulness and Behavior switching
Stateful is no longer a dirty word (kind of…)
The less calls you have for the persistence store the better the
performance will be
Durability is a must (state-awareness)
State goes hand-in-hand with supported behavior
Actors have the power to switch their behaviors at any point in time.
the actor becomes busy or the actor becomes connected.
Which messages to Receive, Deny, Postpone (Stashing)
State machine
20
24. 24
Final thoughts
Testing – easier sometimes, harder sometimes
Dependency injection – injecting ActorRefsActorSelections is not
intuitive
Runtime contract vs. compile-time contract
Your messages are the contract
Messages versioning should be considered up-front
24
25. 25
SUMMARY
o Actor Model
o Semi conductor
o Metrology Target Designer
(MTD) by KLA-Tencor
o Rearchitecting to Actor
Model with Akka.NET
25
http://getakka.net/
https://github.com/akkadotnet/akka.netTamir Dresher (@tamir_dresher)