Erlang and Akka Actors - A story of tradeoffs
The Actor model has long been known to be great at modeling concurrent and parallel problems in a declarative, safe way. The challenge has always been the cost of this abstraction - implementing cheap message passing over a shared-nothing memory architecture while ensuring fairness is a tough ask. In this talk I shall go over how BEAM, with it's three decades of esoteric telecom engineering differs from Akka actors implemented over the JVM, arguably the most invested general purpose VM in existence today.
Along the way, we shall discover how design decisions affect performance at each step of a program's execution - from a global/per-process heap affecting GC latencies and throughput, a type system's effects at efficiency, to preemptive scheduling improving long tail latencies.
Outline/structure of the Session
This talk shall be divided into 4 phases.
- Quick summary of Erlang(BEAM) and Akka(JVM) design choices
- Erlang Actors in depth
- What's the true cost of message passing?
- Latencies: Pre-emptive scheduling and Per-process GC
- Supervision trees, Type-safety and Let-it-Crash
- Akka Actors in depth
- JVM shared-memory model - Perf benefits and consequences
- Global GC - unpredictable long tail latencies
- JVM advantages - JIT, Type System, Mixed Schedulers
This will be a deep-dive, and an attendee can expect to:
- Gain solid intuition into what makes BEAM truly unique at concurrency
- Tradeoffs of implementing the Actor model on a general purpose VM
- Have insights into what metrics/paradigms to consider when evaluating concurrency capabilities of a language.
Intermediate programmers who have worked with concurrent codebases and preferably dabbled with at least one functional language