Overview

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

pekko-persistence-jdbc writes journal and snapshot entries to a configured JDBC store. It implements the full pekko-persistence-query API and is therefore very useful for implementing DDD-style application models using Apache Pekko and Scala for creating reactive applications. It also supports Durable State, although only when using a Postgres or H2 backend.

Apache Pekko Persistence JDBC requires Apache Pekko current 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.

Module info

sbt
val PekkoVersion = "current"
val SlickVersion = "3.3.3"
libraryDependencies ++= Seq(
  "org.apache.pekko" %% "pekko-persistence-jdbc" % "1.0.0",
  "org.apache.pekko" %% "pekko-persistence-query" % PekkoVersion,
  "com.typesafe.slick" %% "slick" % SlickVersion,
  "com.typesafe.slick" %% "slick-hikaricp" % SlickVersion
)
Maven
<properties>
  <pekko.version>current</pekko.version>
  <slick.version>3.3.3</slick.version>
  <scala.binary.version>2.13</scala.binary.version>
</properties>
<dependencies>
  <dependency>
    <groupId>org.apache.pekko</groupId>
    <artifactId>pekko-persistence-jdbc_${scala.binary.version}</artifactId>
    <version>1.0.0</version>
  </dependency>
  <dependency>
    <groupId>org.apache.pekko</groupId>
    <artifactId>pekko-persistence-query_${scala.binary.version}</artifactId>
    <version>${pekko.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 = [
  PekkoVersion: "current",
  SlickVersion: "3.3.3",
  ScalaBinary: "2.13"
]
dependencies {
  implementation "org.apache.pekko:pekko-persistence-jdbc_${versions.ScalaBinary}:1.0.0"
  implementation "org.apache.pekko:pekko-persistence-query_${versions.ScalaBinary}:${versions.PekkoVersion}"
  implementation "com.typesafe.slick:slick_${versions.ScalaBinary}:${versions.SlickVersion}"
  implementation "com.typesafe.slick:slick-hikaricp_${versions.ScalaBinary}:${versions.SlickVersion}"
}
Project Info: Apache Pekko Persistence JDBC
Artifact
org.apache.pekko
pekko-persistence-jdbc
1.0.0
JDK versions
OpenJDK 8
OpenJDK 11
OpenJDK 17
Scala versions2.12.19, 2.13.13
JPMS module namepekko.persistence.jdbc
License
Home pagehttps://pekko.apache.org/docs/pekko-persistence-jdbc/current/
Forums
Release notesGitHub releases
IssuesGitHub issues
Sourceshttps://github.com/apache/pekko-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 Apache Community Code of Conduct.

License

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