🔴 Scala Intermediate

What is Akka and what is the actor model?

Answer

Akka is a toolkit for building highly concurrent, distributed, and resilient systems on the JVM using the actor model. In the actor model: Actors are the fundamental unit of computation — lightweight, isolated objects that process messages from their mailbox sequentially. Message passing: actors communicate only by sending immutable messages — no shared state, no locks. Supervision hierarchy: every actor has a parent that handles its failures (let it crash philosophy). Location transparency: an actor reference (ActorRef) works the same whether the actor is in the same JVM or on a different machine. Akka Typed (current standard) uses type-safe message protocols: object Counter { sealed trait Command; case object Increment extends Command }. Actors are extremely lightweight — millions per JVM. Akka is used in finance, gaming, and telecom for systems requiring high concurrency with fault tolerance.