SlideShare a Scribd company logo
Actors: not just for
movies anymore
Coupling your architecture to physics not fiction
@boulderdanh
@Mtn.
basecamp
Big rewrite of a
database contended
pipeline to an event-
sourced system
"Scaling up" is not a sustainable practice
Scaling to lots of processes is difficult
Languages and frameworks favor running on a
single machine
Designing and tooling for
concurrency can be the answer
Concurrent vs. Parallel
• Simultaneous

• Implementation
• Independent

• Design

• Asynchronous
@ Transmogrify Inc.
Concurrency is planning
The Golder
The Shaper
Construct pipelines
Construct pipelines
Isn't this more work?
VS.
Isn't this slower?
VS.
Scalable
Concurrency Parallelism
Parallelism scales
"The parallelism in today’s machines is limited by the data
dependencies in the program and by memory delays and
resource contention stalls "
A resource
computation 1 computation 2 computation 3 computation 4 computation 5
Concurrency in frameworks
Monolithic
Rails

LAMP
Distributed
Finagle

Erlang / OTP
DB
Web Process
Web Process
Web Process
Web Process
Latent Concurrency
Latent Concurrency
• Concurrency is unplanned

• Rely's on a subset of the system
Web Process
Web Process
Web Process
Web Process
Service A
Service B
Service C
Service D
Service E
Worker
Worker
Worker
Worker
Holistic Concurrency
• Concurrency is planned and constructed
• Concurrency is a property of the system

• Reduction in contention / sharing
Holistic Concurrency
• Parallelizable / Scalable

• Resource density

• Fine grained scaling
Plan for concurrent
systems
The fundamental choice
Shared data
or

Message passing
Concurrency in frameworks
Shared data Message passing
Shared data concurrency
Locks
Semaphores
https://stackoverflow.com/questions/tagged/thread-safety
Synchronization
CAS
Atomic
Memory barriers
STM
JSR-133
Happens before
a tag cloud of pain, in comic sans
Thread safety
Shared data
lots of primitives
Locks
Semaphores
Atomic
Memory barriers
STM
Volatile
Shared data
correctness is elusive
Shared data
"The first huge barrier to bringing clockless
chips to market is the lack of automated
tools to accelerate their design"
Actors: Not Just for Movies Anymore
Actors, abstractly
• create actors

• send messages

• store information for the next message
Implementation
• mailbox

• similar to an object

• concurrency and distribution
Coupled with physics
• Actor sends

• Stop

• +1

• +1

• +1

• What state does it end up in?
Actor
Stop
+1
+1
+1
Actor definition
class Counter extends Actor {

var count = 0



def receive: Receive = {

case Increment(by) => count += by

case Get => sender ! count

}

}
Actor definition
class Counter extends Actor {

def receive = next(0) // initialize base state



def next(count: Int): Receive = {

case Increment(by) => become(next(count + by))

case Get => sender ! count

}

}
store information for the next message
Actors as bank accounts
class BankAccount(name: String) extends Actor {

var count = 0



def receive = {

case Credit(by) => count += by
case Balance => sender ! count

case Debit(by) if (count - by) < 0 => sender ! NSF

case Debit(by) => count -= by

case "whoru?" => sender ! name

}

}
Actors can create actors
class Bank(name: String, insured: Boolean) extends Actor {

def receive = {

case AddAccount(name) =>
context.actorOf(Props(new BankAccount(name)))

}

}
A program using actors
override def main(arg: Array[String]) = {

val system = ActorSystem()

val counter: ActorRef = system.actorOf(Props[Counter])



counter ! Increment(10)


val result = counter ? Get

result.onSuccess { case t => println(t) }

}
A key abstraction
val counter: ActorRef = system.actorOf(Props[Counter])
• The address for an actor

• Tells you nothing about where the actor is

• Deployment is a runtime/config decision
Sending messages
• Asynchronous

• Response is optional
acct ! Increment(10)
acct.tell(Increment(10))
def !(message: Any): Unit
• Still Asynchronous

• Implemented with Actors
Asking for information
(counter ? Get).onSuccess { case t => println(t) }
Actors are great at concurrency
• No synchronization

• Communication is asynchronous

• Late binding deployment decisions
Actors are great at concurrency
• Light weight 

• Actors are micro-services
Surely there are other
ways
Communicating Sequential Processes
Key distinctions
• The channel is fundamental

• Communication is synchronous

• Channels are anonymous vs. named actors
Message passing frameworks
• Streams (Reactive Java)

• DataFlow

• CPS (not to be confused with CSP)
Wrapping up
• Concurrency is inevitable
• Use tools that help you write software to plan for it

• Choose tools that promote message passing

• Scale your systems
Any Questions?
@boulderdanh
References
• Everything you wanted to know about the actor model - http://bit.ly/16O4qSP

• A Universal Modular ACTOR Formalism for Artificial Intelligence - Carl Hewitt 

• Communicating Sequential Processes - C.A.R. Hoare

• Coming Challenges in Microarchitecture and Architecture - Ronny Ronen

• The Tail at Scale - Jeffrey Dean and Luiz André Barroso

More Related Content

PPTX
Text to speech conversation in gujarati
Ashvin Nakum
 
PDF
Effect systems in scala: beyond flatmap
Joost de Vries
 
PPTX
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Thoughtworks
 
PPTX
Основы функционального JS
Анна Луць
 
PDF
Functional Programming #FTW
Adriano Bonat
 
KEY
Scaling small apps
Michael Brunton-Spall
 
PDF
DE Presentation
scstark
 
PPTX
Ajax
dhruvgairola
 
Text to speech conversation in gujarati
Ashvin Nakum
 
Effect systems in scala: beyond flatmap
Joost de Vries
 
Promise of a better future by Rahul Goma Phulore and Pooja Akshantal, Thought...
Thoughtworks
 
Основы функционального JS
Анна Луць
 
Functional Programming #FTW
Adriano Bonat
 
Scaling small apps
Michael Brunton-Spall
 
DE Presentation
scstark
 

Similar to Actors: Not Just for Movies Anymore (20)

PPTX
RxJS and Reactive Programming - Modern Web UI - May 2015
Ben Lesh
 
PDF
Writing Asynchronous Programs with Scala & Akka
Yardena Meymann
 
PPTX
Develop in ludicrous mode with azure serverless
Lalit Kale
 
PPTX
Natural Laws of Software Performance
Gibraltar Software
 
PDF
Functional Programming and Composing Actors
legendofklang
 
PDF
[Meetup ms] Kafka Streams
Cristiano Altmann
 
PPTX
Streaming SQL to unify batch and stream processing: Theory and practice with ...
Fabian Hueske
 
PDF
Using Pony for Fintech
C4Media
 
PDF
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
Amazon Web Services Korea
 
PDF
No stress with state
Uwe Friedrichsen
 
PPTX
10 Big Data Technologies you Didn't Know About
Jesus Rodriguez
 
PPTX
How does the Cloud Foundry Diego Project Run at Scale?
VMware Tanzu
 
PPTX
How does the Cloud Foundry Diego Project Run at Scale, and Updates on .NET Su...
Amit Gupta
 
PDF
Research Automation with Globus Flows.pdf
SusanTussy1
 
PPTX
Reactive Development: Commands, Actors and Events. Oh My!!
David Hoerster
 
PPTX
Debunking Common Myths in Stream Processing
DataWorks Summit/Hadoop Summit
 
PDF
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
confluent
 
PPTX
Kakfa summit london 2019 - the art of the event-streaming app
Neil Avery
 
PDF
Easily Build a Smart Pulsar Stream Processor_Simon Crosby
StreamNative
 
PDF
Flink Forward San Francisco 2019: The Trade Desk's Year in Flink - Jonathan ...
Flink Forward
 
RxJS and Reactive Programming - Modern Web UI - May 2015
Ben Lesh
 
Writing Asynchronous Programs with Scala & Akka
Yardena Meymann
 
Develop in ludicrous mode with azure serverless
Lalit Kale
 
Natural Laws of Software Performance
Gibraltar Software
 
Functional Programming and Composing Actors
legendofklang
 
[Meetup ms] Kafka Streams
Cristiano Altmann
 
Streaming SQL to unify batch and stream processing: Theory and practice with ...
Fabian Hueske
 
Using Pony for Fintech
C4Media
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
Amazon Web Services Korea
 
No stress with state
Uwe Friedrichsen
 
10 Big Data Technologies you Didn't Know About
Jesus Rodriguez
 
How does the Cloud Foundry Diego Project Run at Scale?
VMware Tanzu
 
How does the Cloud Foundry Diego Project Run at Scale, and Updates on .NET Su...
Amit Gupta
 
Research Automation with Globus Flows.pdf
SusanTussy1
 
Reactive Development: Commands, Actors and Events. Oh My!!
David Hoerster
 
Debunking Common Myths in Stream Processing
DataWorks Summit/Hadoop Summit
 
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
confluent
 
Kakfa summit london 2019 - the art of the event-streaming app
Neil Avery
 
Easily Build a Smart Pulsar Stream Processor_Simon Crosby
StreamNative
 
Flink Forward San Francisco 2019: The Trade Desk's Year in Flink - Jonathan ...
Flink Forward
 
Ad

More from VictorOps (20)

PDF
Failure as Success Devops Roadtrip Seattle 2016
VictorOps
 
PPTX
DevOps Roadtrip Final Speaking Deck
VictorOps
 
PDF
DevOps: A Practical Guide
VictorOps
 
PPTX
Crisis Communication Webinar
VictorOps
 
PDF
The Importance of Minimum Viable Runbooks Webinar
VictorOps
 
PPTX
DevOps Roadtrip - Denver
VictorOps
 
PPTX
VictorOps & Raygun: A Stunning Integration
VictorOps
 
PPTX
ChatOps: The New Interface of DevOps
VictorOps
 
PDF
6 Steps to Creating a Minimum Viable Runbook Infographic
VictorOps
 
PDF
Incident Lifecycle Infographic
VictorOps
 
PDF
Crisis Management & Why It's Important Infographic
VictorOps
 
PPTX
Real World ChatOps
VictorOps
 
PPTX
DevOps Culture Shift: Expanding On-Call Responsibilties
VictorOps
 
PDF
Tips & Tricks To Reducing TTR
VictorOps
 
PDF
The Open-Source Monitoring Landscape
VictorOps
 
PDF
An Introduction to Rearview - Time Series Based Monitoring
VictorOps
 
PDF
Putting Devs On-Call: How to Empower Your Team
VictorOps
 
PPTX
The Art & Zen of Managing Nagios with Puppet
VictorOps
 
PPTX
ChatOps Unplugged
VictorOps
 
PDF
Post-mortem Fail
VictorOps
 
Failure as Success Devops Roadtrip Seattle 2016
VictorOps
 
DevOps Roadtrip Final Speaking Deck
VictorOps
 
DevOps: A Practical Guide
VictorOps
 
Crisis Communication Webinar
VictorOps
 
The Importance of Minimum Viable Runbooks Webinar
VictorOps
 
DevOps Roadtrip - Denver
VictorOps
 
VictorOps & Raygun: A Stunning Integration
VictorOps
 
ChatOps: The New Interface of DevOps
VictorOps
 
6 Steps to Creating a Minimum Viable Runbook Infographic
VictorOps
 
Incident Lifecycle Infographic
VictorOps
 
Crisis Management & Why It's Important Infographic
VictorOps
 
Real World ChatOps
VictorOps
 
DevOps Culture Shift: Expanding On-Call Responsibilties
VictorOps
 
Tips & Tricks To Reducing TTR
VictorOps
 
The Open-Source Monitoring Landscape
VictorOps
 
An Introduction to Rearview - Time Series Based Monitoring
VictorOps
 
Putting Devs On-Call: How to Empower Your Team
VictorOps
 
The Art & Zen of Managing Nagios with Puppet
VictorOps
 
ChatOps Unplugged
VictorOps
 
Post-mortem Fail
VictorOps
 
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
The Future of Artificial Intelligence (AI)
Mukul
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 

Actors: Not Just for Movies Anymore