Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Actor Systems In Rust: Techniques and Tradeoffs
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Andrew J. Stone
November 16, 2017
Programming
360
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Actor Systems In Rust: Techniques and Tradeoffs
Andrew J. Stone
November 16, 2017
Transcript
36 slides
Actor Systems in Rust: Techniques and Tradeoffs Andrew J. Stone
Haret Distributed Coordinator and KV Store
Haret Multiple Independent Consensus Groups
Haret Protocol Viewstamped Replication Revisited for Consensus
Haret Backend • Versioned persistent trie per consensus group •
CAS on entire subtrees • Typed Leaves • Blob • Queue • Set
[email protected]
[email protected]
[email protected]
p1 p2 p3 Request (1) Prepare (2)
PrepareOk (3) Prepare (2) PrepareOk (3) Reply (4)
Actors Processes That Communicate Only via Asynchronous Msg Passing
Actors Straightforward Representation of Peers in a Consensus Group
Rabble Actor Abstractions for Implementing Distributed Algorithms
Rabble Dynamic Cluster Membership, Transport and Msg Routing
Rabble Designed for Testability
Rabble A Work in Progress
Rabble Provides a clean way to implement VRR in Haret
Naming pub struct Pid { pub group: Option<String>, pub name:
String, pub node: NodeId, }
Messages pub enum Msg<T> { User(T), ClusterStatus(ClusterStatus), ExecutorStatus(ExecutorStatus), StartTimer(usize), //
time in ms CancelTimer(Option<CorrelationId>), Timeout, Shutdown, GetMetrics, Metrics(Vec<(Name, Metric)>) } { Rabble built-ins User Defined
Envelopes pub struct Envelope<T> { pub to: Pid, pub from:
Pid, pub msg: Msg<T>, pub correlation_id: Option<CorrelationId> }
pub trait Process<T> : Send { /// Handle messages from
other actors fn handle(&mut self, msg: Msg<T>, from: Pid, correlation_id: Option<CorrelationId>, output: &mut Vec<Envelope<T>>); } Processes
Echo Server P1 (Client) Envelope { to: P2, from: P1,
msg: Msg::User<Hello>, correlation_id: Some(P1) } Envelope { to: P1, from: P2, msg: Msg::User<Hello>, correlation_id: Some(P1) } P2 (Server)
impl Process<T> for EchoServer<T> { fn handle(&mut self, msg: Msg<T>,
from: Pid, cid: Option<CorrelationId>, output: &mut Vec<Envelope<T>>) { match msg { Msg::User(Hello) => { let to = from; // P1 let from = self.pid.clone(); // P2 let msg = Msg::User(Hello); let reply = Envelope::new(to, from, msg, cid); output.push(reply); }, _ => () } }
Executor Locates and Runs Processes
P1 P2 P3 Hashmap<Pid, Process> Executor Channel To: P1 Thread
Handle
Property Based Testing 1. Construct a group of processes in
an initial state 2. Generate a schedule of test messages 3. Call the handle method of a process with a test message 4. Collect output messages of handle method 5. Schedule output messages
Test Scheduling Trigger Protocol State Transitions with Explicit Timeouts
Test Assertions •Pre/Post conditions •Global state invariants
Failing Tests Failing Schedules Run as a Regression Suite
Debugging Each Message Receipt is One Step in a Test
Schedule
Cluster Server Non-blocking Single Threaded Server with TCP Connections to
every node
Membership Dynamic Membership Maintained in an Observed-Remove Set
Services Actors that Run Blocking and CPU Intensive Operations
Takeaways
Takeaway Dynamic Messaging is Complex Expensive, and Unergonomic for Distributed
Actors in Rust
Takeaway Writing Good Schedulers is Hard
Takeaway Design your systems to make deterministic testing easier
Takeaway Compromise and Pragmatism allow a good enough solution that
works NOW
Links • https://github.com/andrewjstone/rabble • https://github.com/andrewjstone/orset • https://github.com/vmware/haret
Thanks! Tom Santero Justin Sheehy VMware
More Decks by Andrew J. Stone
See All by Andrew J. Stone
Actor Systems in Rust (Boston Rust Meetup Version)
ajs
0
99
Implementation and Verification of a Consensus Protocol in Erlang
ajs
0
270
Other Decks in Programming
See All in Programming
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
210
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.7k
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
380
AI Augmentation Techniques with Liberty
ivargrimstad
1
490
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
330
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
220
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
160
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
140
Getting Started with Vibe Coding
miccheng
0
230
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
200
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
270
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
760
Featured
See All Featured
For a Future-Friendly Web
brad_frost
184
11k
How to Talk to Developers About Accessibility
jct
2
620
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
570
The Pragmatic Product Professional
lauravandoore
37
7.5k
Unsuck your backbone
ammeep
672
58k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
600
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k