Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is akka and for which purpose it is used?

Tags:

akka

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.

like image 955
swaheed Avatar asked Jul 09 '14 11:07

swaheed


People also ask

Where is Akka framework used?

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.

What is Akka in software?

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.

What problem does Akka solve?

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.

Is Akka widely used?

Akka Actors is a very popular and widely used framework which implements Actors (or for simplicity, lightweight threads) on the JVM.


3 Answers

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.

like image 173
LMeyer Avatar answered Oct 04 '22 08:10

LMeyer


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

like image 35
Konrad 'ktoso' Malawski Avatar answered Oct 04 '22 09:10

Konrad 'ktoso' Malawski


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.

like image 23
Amit Yadav Avatar answered Oct 04 '22 09:10

Amit Yadav