Akka is a
source-available
Source-available software is software released through a source code distribution model that includes arrangements where the source can be viewed, and in some cases modified, but without necessarily meeting the criteria to be called 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.
Language bindings exist for both
Java
Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
and
Scala. Akka is written in Scala and, as of Scala 2.10, the actors in the Scala standard library are deprecated in favor of Akka.
History
An actor implementation, written by Philipp Haller, was released in July 2006 as part of Scala 2.1.7. By 2008 Scala was attracting attention for use in complex server applications, but concurrency was still typically achieved by creating threads that shared memory and synchronized when necessary using locks. Aware of the difficulties with that approach and inspired by the
Erlang programming language's library support for writing highly concurrent, event-driven applications, the Swedish programme
Jonas Bonércreated Akka to bring similar capabilities to Scala and Java. Bonér began working on Akka in early 2009 and wrote up his vision for it in June of that year.
The first public release was Akka 0.5, announced in January 2010. Akka is now part of the Lightbend Platform together with the
Play framework
Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java. ...
and the
Scala programming language.
In September 2022, Lightbend announced that Akka would change its license from the
free software license
A software license is a legal instrument (usually by way of contract law, with or without printed material) governing the use or redistribution of software. Under United States copyright law, all software is copyright protected, in both sour ...
Apache License 2.0 to a
proprietary source-available
Source-available software is software released through a source code distribution model that includes arrangements where the source can be viewed, and in some cases modified, but without necessarily meeting the criteria to be called open-source ...
license, known as the
Business Source License (BSL). Any new code under the BSL would become available under the Apache License after three years.
Distinguishing features
The key points distinguishing applications based on Akka actors are:
* Concurrency is message-based and asynchronous: typically no mutable data are shared and no synchronization primitives are used; Akka implements the
actor model
The actor model in computer science is a mathematical model of concurrent computation that treats ''actor'' as the universal primitive of concurrent computation. In response to a message it receives, an actor can: make local decisions, create mor ...
.
* The way actors interact is the same whether they are on the same host or separate hosts, communicating directly or through routing facilities, running on a few threads or many threads, etc. Such details may be altered at deployment time through a configuration mechanism, allowing a program to be scaled up (to make use of more powerful servers) and out (to make use of more servers) without modification.
* Actors are arranged hierarchically with regard to program failures, which are treated as events to be handled by an actor's supervisor (regardless of which actor sent the message triggering the failure). In contrast to Erlang, Akka enforces parental supervision, which means that each actor is created and supervised by its parent actor.
Akka has a modular structure, with a core module providing actors. Other modules are available to add features such as network distribution of actors,
cluster
may refer to:
Science and technology Astronomy
* Cluster (spacecraft), constellation of four European Space Agency spacecraft
* Asteroid cluster, a small asteroid family
* Cluster II (spacecraft), a European Space Agency mission to study th ...
support, Command and Event Sourcing, integration with various third-party systems (e.g.
Apache Camel,
ZeroMQ), and even support for other concurrency models such as
Futures
Futures may mean:
Finance
*Futures contract, a tradable financial derivatives contract
*Futures exchange, a financial market where futures contracts are traded
* ''Futures'' (magazine), an American finance magazine
Music
* ''Futures'' (album), a ...
and Agents.
Project structure
Viktor Klang became the technical lead for the Akka project in September 2011. When Viktor became Director of Engineering at Lightbend in December 2012, Roland Kuhn became the technical lead for Akka. The main part of the development is done by a core team employed at Lightbend, supported by an active community. The current emphasis is on extending
cluster
may refer to:
Science and technology Astronomy
* Cluster (spacecraft), constellation of four European Space Agency spacecraft
* Asteroid cluster, a small asteroid family
* Cluster II (spacecraft), a European Space Agency mission to study th ...
support.
Relation to other libraries
Other frameworks and toolkits have emerged to form an ecosystem around Akka:
*The Spray toolkit is implemented using Akka and features a
HTTP server
An HTTP server is a computer (software) program (or even a software component included in an other program) that plays the role of a server in a client–server model by implementing the ''server part'' of the HTTP and/or HTTPS network proto ...
as well as related facilities, such as a
domain-specific language (DSL) for creating
RESTful APIs
Apis or APIS may refer to:
* Apis (deity), an ancient Egyptian god
* Apis (Greek mythology), several different figures in Greek mythology
* Apis (city), an ancient seaport town on the northern coast of Africa
**Kom el-Hisn, a different Egyptian ci ...
*The
Play framework
Play Framework is an open-source web application framework which follows the model–view–controller (MVC) architectural pattern. It is written in Scala and usable from other programming languages that are compiled to JVM bytecode, e.g. Java. ...
for developing
web applications
A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.
History
In earlier computing models like client-serve ...
offers integration with Akka
* Up until version 1.6,
Apache Spark
Apache Spark is an open-source unified analytics engine for large-scale data processing. Spark provides an interface for programming clusters with implicit data parallelism and fault tolerance. Originally developed at the University of Califor ...
used Akka for communication between nodes
*The Socko Web Server library supports the implementation of REST APIs for Akka applications
*The ''eventsourced'' library provides
event-driven architecture Event-driven architecture (EDA) is a software architecture paradigm promoting the production, detection, consumption of, and reaction to events.
Overview
An ''event'' can be defined as "a significant change in state". For example, when a consume ...
(see also
domain-driven design
Domain-driven design (DDD) is a major software design approach, focusing on modeling software to match a domain according to input from that domain's experts.
Under domain-driven design, the structure and language of software code (class names, ...
) support for Akka actors
*The
Gatling
The Gatling gun is a rapid-firing multiple-barrel firearm invented in 1861 by Richard Jordan Gatling. It is an early machine gun and a forerunner of the modern electric motor-driven rotary cannon.
The Gatling gun's operation centered on a c ...
stress test tool for load-testing web servers is built upon Akka
*The
Scalatra
Scalatra is a free and open source web application framework written in Scala. It is a port of the Sinatra framework written in Ruby. Scalatra is an alternative to the Lift, Play!, and Unfiltered frameworks.
Scalatra is an example of a microf ...
web framework offers integration with Akka.
*The
Vaadin Vaadin () is an open-source web application development platform for Java. Vaadin includes a set of Web Components, a Java web framework, and a set of tools that enable developers to implement modern web graphical user interfaces (GUI) using the Jav ...
web app development framework can integrate with Akka
*The
Apache Flink
Apache Flink is an open-source, unified stream-processing and batch-processing framework developed by the Apache Software Foundation. The core of Apache Flink is a distributed streaming data-flow engine written in Java and Scala. Flink execu ...
(platform for distributed stream and batch data processing) RPC system is built using Akka but isolated since v1.14.
*The
Lagom
''Lagom'' (pronounced , ) is a Swedish word meaning "just the right amount" or "not too much, not too little".
The word can be variously translated as "in moderation", "in balance", "perfect-simple", "just enough", "ideal" and "suitable" (in mat ...
framework for building reactive microservices is implemented on top of Akka.
There are more than 250 public projects registered on
GitHub
GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, co ...
which use Akka.
Publications about Akka
There are several books about Akka:
*Akka Essentials
*Akka Code Examples
*Akka Concurrency
*Akka in Action
*Effective Akka
*Composable Futures with Akka 2.0, Featuring Java, Scala and Akka Code Examples
Akka also features in:
*P. Haller's "Actors in Scala"
*N. Raychaudhuri's "Scala in Action"
*D. Wampler's "Functional Programming for Java Developers"
*A. Alexander's "Scala Cookbook"
*V. Subramaniam's "Programming Concurrency on the JVM"
*M. Bernhardt's "Reactive Web Applications"
Besides many web articles that describe the commercial use of Akka,
there are also overview articles about it.
References
{{Reflist, 30em
External links
Official website for Akka
Java platform
Software development kits
Java development tools
Actor model (computer science)