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 ...
platform, SDK, toolkit, and runtime simplifying building concurrent and distributed applications on the
JVM
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally descri ...
, for example, agentic AI, microservices, edge/IoT, and streaming applications. Akka supports multiple programming models for concurrency and distribution, but it emphasizes
actor-based concurrency, with inspiration drawn from
Erlang.
Language bindings exist for both
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
and
Scala. Akka is mainly written in Scala.
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, distributed, and event-driven applications, the Swedish programme
Jonas Bonércreated Akka to bring similar capabilities to the JVM. 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.
Akka has now evolved into the Akka Platform, providing a high-level SDK, transparent multi-region and multi-cloud clustering, edge computing allowing building complete Cloud-to-Edge applications, and operational capabilities, with options of running applications in a fully hosted multi-tenant Serverless environment, Bring-Your-Own-Cloud (BYOC) where the application runs in the customer’s cloud but with the control plane fully managed, and Stand-Alone, where the customer is managing everything.
In addition to the Akka Libraries—with the actor-based programming model, clustering, distributed data (CRDTs), event sourcing, persistence, streaming, brokerless pub-sub, and more—Akka now also has a high-level SDK layered on top of the Akka Libraries, consisting of a highly opinionated and guard-railed developer experience through high-level components (Entity, View, Workflow, Endpoint, Consumer, Timer) and a local development environment (sandbox, console, etc.).
In September 2022, Lightbend announced that Akka would change its license from the
free software license
A software license is a legal instrument governing the use or redistribution of software.
Since the 1970s, software copyright has been recognized in the United States. Despite the copyright being recognized, most companies prefer to sell lic ...
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 are:
* Asynchronous and non-blocking communication, distribution, and concurrency: Akka applications are event-based, asynchronous, and non-blocking: 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 an ''actor'' as the basic building block of concurrent computation. In response to a message it receives, an actor can: make local decisions, create ...
with support for streaming, Publish-Subscribe, HTTP, gRPC, and multiple other protocols (through the Alpakka module).
* Location transparency: The way Akka-based services/agents interact is the same whether they are on the same host or separate hosts (cores, nodes, data centers, or clouds), communicating directly or through routing facilities. This means that the topology of the application is not fixed but dynamic and may be altered at deployment time through a configuration mechanism, allowing a program to be scaled up (to make use of more powerful servers), out (to make use of more servers), and clustered, without modification.
* Self-healing through declarative failure management: Actors are arranged hierarchically in so-called ‘supervisor hierarchies’. Failures are treated as immutable facts, reified events, and sent asynchronously to the component’s supervisor, who can manage the failure in a safe and healthy context outside of the failed component (which, thanks to location transparency, can be on another node or even data center). In contrast to Erlang, Akka enforces parental supervision, which means that each actor is created and supervised by its parent actor.
* Durable replicated in-memory persistence: Akka services/agents are durable with their in-memory state acting as the source of truth and each state-changing event (immutable fact) is logged to disk in the order they arrive leveraging so-called event-sourcing. Replaying the event log allows them to gracefully recover from failure, sourcing replicas, and provides a built in audit log (full history) of everything that has happened in the system.
* Multi-region/multi-cloud clustering: Akka services/agents are clustered automatically “from within”. Each service is its own fully replicated and sharded cluster of nodes that can span multiple data centers, regions, clouds, or span from the cloud to the edge.
The programming model for Akka consists of Akka SDK and Akka Libraries:
* Akka Libraries is an open-ended toolkit for building distributed systems. It has a modular structure, with a core module providing actors. Other modules are available to add features such as network distribution of actors,
cluster support, Command and Event Sourcing, data distribution and management (through CRDTs and event logging), integration with various third-party systems through the Alpakka streaming integration module, and even support for other concurrency models such as asynchronous stream-processing and
Futures.
* Akka SDK is a high-level and opinionated framework built on top of the Akka Libraries. It encodes the most common and useful patterns and best practices learned from the use of Akka Libraries through a set of discrete composable components (Entity, View, Endpoint, Workflow, Consumer, and Timer) allowing developers to build highly responsive, scalable, resilient, distributed agentic and services-based applications.
Relation to other libraries
Other frameworks and toolkits have emerged to form an ecosystem around Akka:
*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 created with web technologies and runs via a web browser. Web applications emerged during the late 1990s and allowed for the server to dynamically build a response to the request, ...
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 Californ ...
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 concerning the production and detection of Event (computing), events. Event-driven architectures are Continuous design, evolutionary in nature and provide a high degree of fault to ...
(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. DDD is against the idea of having a single unified model; instead it divides a large s ...
) support for Akka actors
*The
Gatling
The Gatling gun is a rapid-firing multiple-barrel firearm invented in 1861 by Richard Jordan Gatling of North Carolina. It is an early machine gun and a forerunner of the modern electric motor-driven rotary cannon.
The Gatling gun's oper ...
stress test tool for load-testing web servers is built upon Akka
*The
Scalatra 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 ...
web app development framework can integrate with Akka
*The
Apache Flink
Apache Flink is an Open-source software, open-source, unified stream processing, stream-processing and batch processing, batch-processing software framework, framework developed by the Apache Software Foundation. The core of Apache Flink is a dis ...
(platform for distributed stream and batch data processing) RPC system is built using Akka but isolated since v1.14.
*The
Lagom framework for building reactive microservices is implemented on top of Akka.
There are more than 250 public projects registered on
GitHub
GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
which use Akka.
Publications about Akka
There are several books about Akka:
*Akka Essentials
*Akka Code Examples
*Akka Concurrency
*Akka in Action, Second Edition
*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)
Software using the Business Source License