In this blog I’m going to talk about Akka – What is Akka, some design principles behind it, and why was it developed. So let’s begin.
What is Akka?
Akka is a toolkit and runtime for building highly concurrent, distributed, and fault-tolerant message-driven applications on the JVM (Java Virtual Machine).
So, understanding each keyword-
Toolkit – By toolkit, it means that it’s not heavy-weight. The idea is that it’s fairly modular so we can use the pieces as we need.
Highly Concurrent and Distributed – It is powerful and helps in making highly scalable applications.
Fault-Tolerant – It also provides a lot of features that provide added resilience.
Message Driven – Everything is driven by messages.
Akka is written in Scala. It implements the Actor Based Model. The Actor Model makes it easier to write a correct concurrent and parallel application.
Why named Akka?
The term “AKKA” is new for all. So where is it derived from?
It is the name of a beautiful Swedish mountain up in the northern part of Sweden called Laponia. It is also the name of a goddess in the Sami (the native Swedish population) mythology. She is the goddess that stands for all the beauty and good in the world.
Akka is Reactive
Akka is reactive. It has 4 reactive principles. These come from the Reactive Manifesto. You can check about it in the link provided: https://www.reactivemanifesto.org/. The principles are as follows;
- Responsive: It means that the system responds in a timely manner.
- Resilient: System also stays responsive in the face of failure.
- Elastic: The system stays responsive under varying workloads.
- Message Driven: System foundation for elastic and resilient responsiveness.
Akka’s Value Proposition
Akka provides a single unified programming model for:
- Simpler Concurrency: By concurrency, we mean that multiple computations are happening at the same time. Akka is based on the Actor model and actors let us write code in a single-threaded illusion. Therefore, each Actor will only process one process at a time.
- Simpler Distribution: Everything in Akka is distributed by default. So it doesn’t matter whether we are working with local or remote actors.
- Simpler Fault Tolerance: Akka provides failure handling via Supervisors. They handle failure and callers need not care(they can’t anyway).
This is the basic introduction. Later we are going to talk about the Actor model and Actors.