I want to know what is the use of Akka
.
I read about it from the internet, and know that it is a toolkit and uses the Actor model system. After this I studied about the Actor model system in which there are different actors that can message each other and initiate action.
I also know that Akka helps provide concurrency and avoid the locking mechanism. But even after reading all this I am unable to summarize exactly what Akka is and why we use it? Also, how is it used?
Can anyone please elaborate it to me in simple words? Thanks.
Akka is very useful to write server side scalable application. Using Akka, it is very easy to send messages to various nodes of your application. In simple language you can run your application in several no. of machines according to load and akka will handle its traffic.
Akka is a free and open-source toolkit and runtime simplifying the construction of concurrent and distributed applications on the JVM. Akka supports multiple programming models for concurrency, but it emphasizes actor-based concurrency, with inspiration drawn from Erlang. Akka.
Akka.NET uses the actor model to overcome the limitations of traditional object-oriented programming models and meet the unique challenges of highly distributed systems.
Akka Actors is a very popular and widely used framework which implements Actors (or for simplicity, lightweight threads) on the JVM.
In a nutshell, Akka is a convenient framework for doing reactive and distributed application on the JVM. It is based on the reactive manifesto and therefore it is :
Event-driven with message passing (i.e loosely coupled)
Resilient through the use of supervision strategies, death watch and hierarchies.
Scalable and responsive thanks to saving resources with your actors sharing threads in a non-blocking way. Before, when you were challenged with concurrency problems, you used to have locking mechanisms blocking the current thread and context switching.
Disregarding the performance themselves, the actor model is also much more simple to reason about. Thinking of interactions between people (i.e actors) is easier than thinking of avoiding deadlocks and starvations. So should we always use Akka ? Well if you're a real shared state concurrency guru and you want the very best performance for specific stuff, then no. If you're like most of us, then you can.
Simply said, Akka saves you from the trouble of dealing with low-level concurrency primitives yourself when writing multi-threaded high performance apps. Instead you can use Actors, a higher level construct, to write your concurrent code. The same model then scales transparently (and much more "feels-right") to distributed systems, as Actors always communicate via messages, regardless if an Actor is local or on a different node.
There are different modules, like HTTP, streams or persistence - aimed at different concrete problems, but Akka's Actors would be the heart of the project.
You can look at the different activator templates to see some example apps and explanations: https://typesafe.com/activator/templates#filter:akka
Akka is very useful to write server side scalable application. Using Akka, it is very easy to send messages to various nodes of your application. In simple language you can run your application in several no. of machines according to load and akka will handle its traffic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With