SlideShare a Scribd company logo
7
Most read
8
Most read
14
Most read
Actor Pattern and NATS
Charlie Strawn and Steven Osborne
Basic Outline
● Introduction to Actor Model
● Similarities to decoupled pub-sub
● Simple NATS-Akka connector
● NATS Actor implementation
Actor Model
Actor Model
The actor model is comprised of a system of actors. An actor is a primitive that
embodies
1. Processing
2. Storage
3. Communication
In an actor system everything is an actor. Actor people love the “one ant is no ant”
analogy: One actor is no actor - they come in systems.
Actor Model
When an actor receives a message it can
1. Send messages to other actors
2. Create new actors
3. Designate the behavior to be used for the next message it receives
This is the real key. The actor is always doing work reacting to some message.
Actor Model - Key points
● Actors can live anywhere.
● There is no shared state among actors. Let it crash.
● Each actor has an address at which it receives messages.
● There is a many-to-many relationship between actors and addresses.
● Messages are delivered at most once.
● Actors process messages serially.
Actor Model - Key points
● The model is inherently concurrent (yey!) so keep computation lightweight
and consistent
● Throughput is king
● Each actor processes messages serially - so avoid blocking (except for
unavoidable ops like I/O)
● The unit of concurrency is actor - so all computation within the actor is serial.
If the actor has too much work and needs more processing power it creates
and messages other actors.
Good synopsis...
If we’ve piqued your interest in actors but find our summary lacking content -
check out this video from Carl Hewitt - the original designer of the Actor Model.
https://www.youtube.com/watch?v=7erJ1DV_Tlo
Or just do the sane thing and search youtube for “the actor model”. It’s the first
one.
Akka
● Akka is Java/Scala library that implements the actor model. Akka is
especially well suited to an EventBus style implementation of pub sub. http:
//doc.akka.io/docs/akka/current/scala/event-bus.html
● 1-to-1 Message to Event
● Effective Akka
Ok, great, isn’t this a NATS talk?
NATS is clearly not an actor model - it’s a communication protocol. That being
said, it upholds many of the basic tenants embraced by the actor model.
● Decoupled sender/receiver (i.e. publisher-subscriber)
● Publishers and subscribers can live anywhere
● Messages are delivered at most once
● Lightweight and high throughput
NATS-Akka
Let’s take the low hanging fruit here - we should be able to connect NATS to an
existing actor model implementation. Better yet, let’s take the lowest of the fruit -
NATS connector framework (in Java) to Akka (also Java).
Lets combine the speed and simplicity of NATS with the speed and simplicity of
Akka.
NATS-Akka-Connector
Demo!
Akka Clustering
● Akka has a built-in clustering module - but it’s based on complicated on
somewhat complicated tcp routing configuration.
● With NATS as the communication point between nodes - clustering akka is
simple.
Connecting to an actor system is cool, but...
What if the actor system was built on top of NATS?
Then multi-node would be a cinch. Setup would be quick. Message latency would
be low. Actor Systems could span languages (i.e. have java actors that interacts
with legacy apis, go actors to do some heavy lifting, and some rust actors to just
be awesome).
Let’s try it out
Demo!
https://github.com/sosborne/nats-actor/tree/actor
More work
● Actually implement akka clustering using NATS as the message transport
across cluster nodes
● Multi-node go nats-actor implementation
● More languages for nats-actor (maybe rust? Shameless plug…)
Thanks!
Some good resources
http://doc.akka.io/docs/akka/current/scala/event-bus.html
https://github.com/vrcod/akka-sample-twitter-streaming
http://akka.io/
http://www.brianstorti.com/the-actor-model/

More Related Content

KEY
Introduction to Actor Model and Akka
Yung-Lin Ho
 
PPTX
Akka framework
mitesh_sharma
 
PPTX
Introduction to actor model with examples on Akka.NET
Arthur Shvetsov
 
PDF
Introduction to Akka
Knoldus Inc.
 
KEY
Actors and Threads
mperham
 
PDF
Scala Italy 2015 - An Introduction to Akka and the Actor Based Model
Daniela Sfregola
 
ODP
Actors, Fault tolerance and OTP
Dhananjay Nene
 
PDF
Lightning talk dexterity behaviors and mosaic
Robert Niederreiter
 
Introduction to Actor Model and Akka
Yung-Lin Ho
 
Akka framework
mitesh_sharma
 
Introduction to actor model with examples on Akka.NET
Arthur Shvetsov
 
Introduction to Akka
Knoldus Inc.
 
Actors and Threads
mperham
 
Scala Italy 2015 - An Introduction to Akka and the Actor Based Model
Daniela Sfregola
 
Actors, Fault tolerance and OTP
Dhananjay Nene
 
Lightning talk dexterity behaviors and mosaic
Robert Niederreiter
 

What's hot (17)

PPTX
Project presentation
Varun Gupta
 
PPTX
Managing state in modern React web applications
Jon Preece
 
PPTX
Akka - young fighter course
Dmitriy Gutman
 
PDF
Concurrency in Smalltalk -- Beyond Threads
ESUG
 
PPTX
2 mins intro of akka
Huangmao Quan
 
PDF
Dive into Akka Actors
Knoldus Inc.
 
PPTX
Actor Model & Reactive Manifesto
Angelo Simone Scotto
 
PPTX
Java Interface
Pushpendra Tyagi
 
PPTX
Concurrent Applications with F# Agents
Rachel Reese
 
PDF
[CocoaHeads Tricity] Michał Zygar - Consuming API
CocoaHeads Tricity
 
PPTX
Exploring Akka Typed
Iain Hull
 
PDF
Elixir for Rubyists
Maarten van Vliet
 
PPTX
Основы функционального JS
Анна Луць
 
PDF
Javascript for Intermediates
Ankit Agrawal
 
PPTX
DDD loves Actor Model and Actor Model loves Elixir
Gianluca Padovani
 
PDF
BDD: WTF?@#
Alex Litvinok
 
PDF
Alexander Litvinok (software engineer) "bdd wtf"
EPAM Systems
 
Project presentation
Varun Gupta
 
Managing state in modern React web applications
Jon Preece
 
Akka - young fighter course
Dmitriy Gutman
 
Concurrency in Smalltalk -- Beyond Threads
ESUG
 
2 mins intro of akka
Huangmao Quan
 
Dive into Akka Actors
Knoldus Inc.
 
Actor Model & Reactive Manifesto
Angelo Simone Scotto
 
Java Interface
Pushpendra Tyagi
 
Concurrent Applications with F# Agents
Rachel Reese
 
[CocoaHeads Tricity] Michał Zygar - Consuming API
CocoaHeads Tricity
 
Exploring Akka Typed
Iain Hull
 
Elixir for Rubyists
Maarten van Vliet
 
Основы функционального JS
Анна Луць
 
Javascript for Intermediates
Ankit Agrawal
 
DDD loves Actor Model and Actor Model loves Elixir
Gianluca Padovani
 
BDD: WTF?@#
Alex Litvinok
 
Alexander Litvinok (software engineer) "bdd wtf"
EPAM Systems
 
Ad

Viewers also liked (20)

PDF
How Greta uses NATS to revolutionize data distribution on the Internet
Apcera
 
PPTX
Patterns for Asynchronous Microservices with NATS
Apcera
 
PDF
Debugging Network Issues
Apcera
 
PDF
Implementing Microservices with NATS
Apcera
 
PDF
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Apcera
 
PDF
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Apcera
 
PDF
Kubernetes, The Day After
Apcera
 
PDF
Nats in action a real time microservices architecture handled by nats
Raul Perez
 
PDF
Build Golang projects properly with Makefiles
Raül Pérez
 
PDF
οργάνωση, διοίκηση και λειτουργία ενός γραφείου εισερχομένου τουρισμού
Stamatina Kanta
 
PDF
How to Migrate to Cloud with Complete Confidence and Trust
Apcera
 
PPTX
Levent Nart Dinamikler 2016
Dinamikler
 
PPTX
Merve Taşkan Dinamikler 2016
Dinamikler
 
PPTX
Sherif Adel Medhar Dinamikler 2016
Dinamikler
 
PDF
Blaze clan company presentation
Supratik Ghatak
 
PPTX
Metin Örnek Dinamikler 2016
Dinamikler
 
PDF
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
Blazeclan Technologies Private Limited
 
PDF
Cloudbakers' Presentation at Jobg8's Job Board Summit 2013
cloudbakers
 
PDF
Melda Polat Dinamikler 2016
Dinamikler
 
PPTX
Office 365 Hizmetlere Genel Bakış ve Exchange Online
Mustafa
 
How Greta uses NATS to revolutionize data distribution on the Internet
Apcera
 
Patterns for Asynchronous Microservices with NATS
Apcera
 
Debugging Network Issues
Apcera
 
Implementing Microservices with NATS
Apcera
 
Simple and Scalable Microservices: Using NATS with Docker Compose and Swarm
Apcera
 
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Apcera
 
Kubernetes, The Day After
Apcera
 
Nats in action a real time microservices architecture handled by nats
Raul Perez
 
Build Golang projects properly with Makefiles
Raül Pérez
 
οργάνωση, διοίκηση και λειτουργία ενός γραφείου εισερχομένου τουρισμού
Stamatina Kanta
 
How to Migrate to Cloud with Complete Confidence and Trust
Apcera
 
Levent Nart Dinamikler 2016
Dinamikler
 
Merve Taşkan Dinamikler 2016
Dinamikler
 
Sherif Adel Medhar Dinamikler 2016
Dinamikler
 
Blaze clan company presentation
Supratik Ghatak
 
Metin Örnek Dinamikler 2016
Dinamikler
 
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
Blazeclan Technologies Private Limited
 
Cloudbakers' Presentation at Jobg8's Job Board Summit 2013
cloudbakers
 
Melda Polat Dinamikler 2016
Dinamikler
 
Office 365 Hizmetlere Genel Bakış ve Exchange Online
Mustafa
 
Ad

Similar to Actor Patterns and NATS - Boulder Meetup (20)

PPTX
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
petabridge
 
PDF
Introduction to the Actor Model
BoldRadius Solutions
 
PDF
Akka-intro-training-public.pdf
BernardDeffarges
 
PDF
Actors evolved- Rotem Hermon
distributed matters
 
PDF
Model with actors and implement with Akka
Ngoc Dao
 
PPTX
Akka Actors
Dylan Forciea
 
PPTX
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
PDF
Actor model in .NET - Akka.NET
Konrad Dusza
 
PPTX
Akka dotnet presentation ndc 2017
Francis Dougherty Paulin
 
PDF
Meet the actor model (silent story)
Gabi Costel Lapusneanu
 
PPTX
Akka.Net Overview
Geoffrey Vandiest
 
PDF
Actor-based concurrency in a modern Java Enterprise
Alexander Lukyanchikov
 
PDF
Building reactive distributed systems with Akka
Johan Andrén
 
PPTX
Reactive Programming using Actor Model in Akka
StephenKoc1
 
PDF
Akka - A Brief Intro
Thomas Lockney
 
PDF
Buiilding reactive distributed systems with Akka
Johan Andrén
 
PPTX
Fundamentals of Akka - Webinar
Knoldus Inc.
 
PDF
Akka lsug skills matter
Skills Matter
 
PDF
Scaling Web Apps with Akka
Maciej Matyjas
 
PDF
Introducing Akka
Jonas Bonér
 
DotNext 2020 - When and How to Use the Actor Model and Akka.NET
petabridge
 
Introduction to the Actor Model
BoldRadius Solutions
 
Akka-intro-training-public.pdf
BernardDeffarges
 
Actors evolved- Rotem Hermon
distributed matters
 
Model with actors and implement with Akka
Ngoc Dao
 
Akka Actors
Dylan Forciea
 
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
Actor model in .NET - Akka.NET
Konrad Dusza
 
Akka dotnet presentation ndc 2017
Francis Dougherty Paulin
 
Meet the actor model (silent story)
Gabi Costel Lapusneanu
 
Akka.Net Overview
Geoffrey Vandiest
 
Actor-based concurrency in a modern Java Enterprise
Alexander Lukyanchikov
 
Building reactive distributed systems with Akka
Johan Andrén
 
Reactive Programming using Actor Model in Akka
StephenKoc1
 
Akka - A Brief Intro
Thomas Lockney
 
Buiilding reactive distributed systems with Akka
Johan Andrén
 
Fundamentals of Akka - Webinar
Knoldus Inc.
 
Akka lsug skills matter
Skills Matter
 
Scaling Web Apps with Akka
Maciej Matyjas
 
Introducing Akka
Jonas Bonér
 

More from Apcera (20)

PDF
Gopher fest 2017: Adding Context To NATS
Apcera
 
PDF
How Clarifai uses NATS and Kubernetes for Machine Learning
Apcera
 
PPTX
Modernizing IT in the Platform Era
Apcera
 
PDF
IT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind
Apcera
 
PDF
The Zen of High Performance Messaging with NATS
Apcera
 
PPTX
NATS for Modern Messaging and Microservices
Apcera
 
PDF
NATS Connector Framework - Boulder Meetup
Apcera
 
PDF
Simple Solutions for Complex Problems - Boulder Meetup
Apcera
 
PDF
NATS vs HTTP
Apcera
 
PDF
Micro on NATS - Microservices with Messaging
Apcera
 
PDF
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
Apcera
 
PDF
Securing the Cloud Native Stack
Apcera
 
PDF
Simple Solutions for Complex Problems
Apcera
 
PDF
KURMA - A Containerized Container Platform - KubeCon 2016
Apcera
 
PDF
Integration Patterns and Anti-Patterns for Microservices Architectures
Apcera
 
PDF
NATS: Control Flow for Distributed Systems
Apcera
 
PDF
Integration Patterns for Microservices Architectures
Apcera
 
PDF
Nats meetup sf 20150826
Apcera
 
PDF
Microservices: Notes From The Field
Apcera
 
PDF
Docker + App Container = ocp
Apcera
 
Gopher fest 2017: Adding Context To NATS
Apcera
 
How Clarifai uses NATS and Kubernetes for Machine Learning
Apcera
 
Modernizing IT in the Platform Era
Apcera
 
IT Modernization Doesn’t Mean You Leave Your Legacy Apps Behind
Apcera
 
The Zen of High Performance Messaging with NATS
Apcera
 
NATS for Modern Messaging and Microservices
Apcera
 
NATS Connector Framework - Boulder Meetup
Apcera
 
Simple Solutions for Complex Problems - Boulder Meetup
Apcera
 
NATS vs HTTP
Apcera
 
Micro on NATS - Microservices with Messaging
Apcera
 
NATS: A Central Nervous System for IoT Messaging - Larry McQueary
Apcera
 
Securing the Cloud Native Stack
Apcera
 
Simple Solutions for Complex Problems
Apcera
 
KURMA - A Containerized Container Platform - KubeCon 2016
Apcera
 
Integration Patterns and Anti-Patterns for Microservices Architectures
Apcera
 
NATS: Control Flow for Distributed Systems
Apcera
 
Integration Patterns for Microservices Architectures
Apcera
 
Nats meetup sf 20150826
Apcera
 
Microservices: Notes From The Field
Apcera
 
Docker + App Container = ocp
Apcera
 

Recently uploaded (20)

PDF
Doc9.....................................
SofiaCollazos
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Doc9.....................................
SofiaCollazos
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Software Development Methodologies in 2025
KodekX
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
The Future of Artificial Intelligence (AI)
Mukul
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 

Actor Patterns and NATS - Boulder Meetup

  • 1. Actor Pattern and NATS Charlie Strawn and Steven Osborne
  • 2. Basic Outline ● Introduction to Actor Model ● Similarities to decoupled pub-sub ● Simple NATS-Akka connector ● NATS Actor implementation
  • 4. Actor Model The actor model is comprised of a system of actors. An actor is a primitive that embodies 1. Processing 2. Storage 3. Communication In an actor system everything is an actor. Actor people love the “one ant is no ant” analogy: One actor is no actor - they come in systems.
  • 5. Actor Model When an actor receives a message it can 1. Send messages to other actors 2. Create new actors 3. Designate the behavior to be used for the next message it receives This is the real key. The actor is always doing work reacting to some message.
  • 6. Actor Model - Key points ● Actors can live anywhere. ● There is no shared state among actors. Let it crash. ● Each actor has an address at which it receives messages. ● There is a many-to-many relationship between actors and addresses. ● Messages are delivered at most once. ● Actors process messages serially.
  • 7. Actor Model - Key points ● The model is inherently concurrent (yey!) so keep computation lightweight and consistent ● Throughput is king ● Each actor processes messages serially - so avoid blocking (except for unavoidable ops like I/O) ● The unit of concurrency is actor - so all computation within the actor is serial. If the actor has too much work and needs more processing power it creates and messages other actors.
  • 8. Good synopsis... If we’ve piqued your interest in actors but find our summary lacking content - check out this video from Carl Hewitt - the original designer of the Actor Model. https://www.youtube.com/watch?v=7erJ1DV_Tlo Or just do the sane thing and search youtube for “the actor model”. It’s the first one.
  • 9. Akka ● Akka is Java/Scala library that implements the actor model. Akka is especially well suited to an EventBus style implementation of pub sub. http: //doc.akka.io/docs/akka/current/scala/event-bus.html ● 1-to-1 Message to Event ● Effective Akka
  • 10. Ok, great, isn’t this a NATS talk? NATS is clearly not an actor model - it’s a communication protocol. That being said, it upholds many of the basic tenants embraced by the actor model. ● Decoupled sender/receiver (i.e. publisher-subscriber) ● Publishers and subscribers can live anywhere ● Messages are delivered at most once ● Lightweight and high throughput
  • 11. NATS-Akka Let’s take the low hanging fruit here - we should be able to connect NATS to an existing actor model implementation. Better yet, let’s take the lowest of the fruit - NATS connector framework (in Java) to Akka (also Java). Lets combine the speed and simplicity of NATS with the speed and simplicity of Akka.
  • 13. Akka Clustering ● Akka has a built-in clustering module - but it’s based on complicated on somewhat complicated tcp routing configuration. ● With NATS as the communication point between nodes - clustering akka is simple.
  • 14. Connecting to an actor system is cool, but... What if the actor system was built on top of NATS? Then multi-node would be a cinch. Setup would be quick. Message latency would be low. Actor Systems could span languages (i.e. have java actors that interacts with legacy apis, go actors to do some heavy lifting, and some rust actors to just be awesome).
  • 15. Let’s try it out Demo! https://github.com/sosborne/nats-actor/tree/actor
  • 16. More work ● Actually implement akka clustering using NATS as the message transport across cluster nodes ● Multi-node go nats-actor implementation ● More languages for nats-actor (maybe rust? Shameless plug…)