Overview

The Akka Persistence JDBC plugin allows for using JDBC-compliant databases as backend for Akka Persistence and Akka Persistence Query.

akka-persistence-jdbc writes journal and snapshot entries to a configured JDBC store. It implements the full akka-persistence-query API and is therefore very useful for implementing DDD-style application models using Akka and Scala for creating reactive applications.

Akka Persistence JDBC requires Akka 2.6.10 or later. It uses Slick 3.3.3 internally to access the database via JDBC, this does not require user code to make use of Slick.

Version history

Description Version Akka version
New database schema, see Migration 5.0.0 Akka 2.6.+
First release within the Akka organization 4.0.0 Akka 2.6.+
Requires Akka 2.5.0 3.5.3+ Akka 2.5.23+ or 2.6.x

See the full release history at GitHub releases.

Module info

sbt
val AkkaVersion = "2.6.10"
val SlickVersion = "3.3.3"
libraryDependencies ++= Seq(
  "com.lightbend.akka" %% "akka-persistence-jdbc" % "5.0.1+4-61d56489-SNAPSHOT",
  "com.typesafe.akka" %% "akka-persistence-query" % AkkaVersion,
  "com.typesafe.slick" %% "slick" % SlickVersion,
  "com.typesafe.slick" %% "slick-hikaricp" % SlickVersion
)
Maven
<properties>
  <akka.version>2.6.10</akka.version>
  <slick.version>3.3.3</slick.version>
  <scala.binary.version>2.13</scala.binary.version>
</properties>
<dependencies>
  <dependency>
    <groupId>com.lightbend.akka</groupId>
    <artifactId>akka-persistence-jdbc_${scala.binary.version}</artifactId>
    <version>5.0.1+4-61d56489-SNAPSHOT</version>
  </dependency>
  <dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-persistence-query_${scala.binary.version}</artifactId>
    <version>${akka.version}</version>
  </dependency>
  <dependency>
    <groupId>com.typesafe.slick</groupId>
    <artifactId>slick_${scala.binary.version}</artifactId>
    <version>${slick.version}</version>
  </dependency>
  <dependency>
    <groupId>com.typesafe.slick</groupId>
    <artifactId>slick-hikaricp_${scala.binary.version}</artifactId>
    <version>${slick.version}</version>
  </dependency>
</dependencies>
Gradle
def versions = [
  AkkaVersion: "2.6.10",
  SlickVersion: "3.3.3",
  ScalaBinary: "2.13"
]
dependencies {
  implementation "com.lightbend.akka:akka-persistence-jdbc_${versions.ScalaBinary}:5.0.1+4-61d56489-SNAPSHOT"
  implementation "com.typesafe.akka:akka-persistence-query_${versions.ScalaBinary}:${versions.AkkaVersion}"
  implementation "com.typesafe.slick:slick_${versions.ScalaBinary}:${versions.SlickVersion}"
  implementation "com.typesafe.slick:slick-hikaricp_${versions.ScalaBinary}:${versions.SlickVersion}"
}
Project Info: Akka Persistence JDBC
Artifact
com.lightbend.akka
akka-persistence-jdbc
5.0.1+4-61d56489-SNAPSHOT
JDK versions
Adopt OpenJDK 8
Adopt OpenJDK 11
Scala versions2.12.13, 2.13.4
JPMS module nameakka.persistence.jdbc
License
Readiness level
Since 4.0.0, 2020-06-09
Home pagehttps://doc.akka.io/docs/akka-persistence-jdbc/current/
Forums
Release notesGitHub releases
IssuesGitHub issues
Sourceshttps://github.com/akka/akka-persistence-jdbc

Contribution policy

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project’s open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project’s open source license and warrant that you have the legal authority to do so.

Code of Conduct

Contributors all agree to follow the Lightbend Community Code of Conduct.

License

This source code is made available under the Apache 2.0 License.

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.