3. • A Scala and Java framework for scalability, fault-tolerance,
concurrency and remoting through actors.
• Inspired by Erlang OTP.
• Developed by Typesafe: https://www.typesafe.com/.
9. • Originate in a 1973 paper by Carl Hewitt
• Implemented in Erlang
• Encapsulate state and behavior
• Closer to the definition of OO than classes
10. • Implements Message-Passing Concurrency
• Share nothing
• Isolated lightweight processes
• Communicates through messages
• Asynchronous and non-blocking
11. Concurrency model
• No shared state – no synchronization
• Each actor has a mailbox (message queue)
• Non-blocking send
• Blocking receive
• Messages are immutable
12. userActor ! User(“John Doe”)
class UserActor extends Actor {
def receive = {
case User(name) => sender ! “Hi $name”
}
}
21. Going remote
• Everything works using asynchronous message passing which is
good for remoting
• Akka-remoting allows working with remote actors just as if they were
in the same JVM
• Still need to handle additional issues like serialization and handling
potential networking problems
22. Akka Cluster
• Based on DynamoDB clustering
• Completely decentralized, uses gossip protocol for membership and
failure detection
• Cluster aware routers can be used for balancing tasks across the
cluster