/akka-persistence-jdbc

Synchronously writes journal and snapshot entries to configured JDBC databases so that Akka Actors can recover state

Primary LanguageScalaApache License 2.0Apache-2.0

akka-persistence-jdbc

Akka-persistence-jdbc is a plugin for akka-persistence that synchronously writes journal and snapshot entries entries to a configured JDBC store. It supports writing journal messages and snapshots to two tables: the journal table and the snapshot table.

Service Status Description
License License Apache 2.0
Travis (master) Build Status: Master master branch test
Travis (2.4.0-xx) Build Status: 2.4.0-xx 2.4.0-xx branch test
Codacy Codacy Badge Code Quality
Bintray Download Latest Version on Bintray

By setting the appropriate Journal and SnapshotStore classes in the application.conf, you can choose the following databases:

  • H2 (tested, works on 1.4.179)
  • Postgresql (tested, works on v9.4)
  • MySQL (tested, works on 5.7 MySQL Community Server (GPL))
  • Oracle XE (tested, works on Oracle XE 11g r2)

Start of Disclaimer:

This plugin should not be used in production, ever! For a good, stable and scalable solution use Apache Cassandra with the akka-persistence-cassandra plugin Only use this plug-in for study projects and proof of concepts. Please use Docker and library/cassandra You have been warned!

End of Disclaimer

Dependency

To include the JDBC plugin into your sbt project, add the following lines to your build.sbt file:

resolvers += "dnvriend at bintray" at "http://dl.bintray.com/dnvriend/maven"

libraryDependencies += "com.github.dnvriend" %% "akka-persistence-jdbc" % "1.1.8"

For Maven users, add the following to the pom.xml

<dependency>
    <groupId>com.github.dnvriend</groupId>
    <artifactId>akka-persistence-jdbc_2.10</artifactId>
    <version>1.1.8</version>
</dependency>

<dependency>
    <groupId>com.github.dnvriend</groupId>
    <artifactId>akka-persistence-jdbc_2.11</artifactId>
    <version>1.1.8</version>
</dependency>

Add the following to the repositories section of the pom:

<repository>
  <snapshots><enabled>false</enabled></snapshots>
  <id>central</id>
  <name>bintray</name>
  <url>http://dl.bintray.com/dnvriend/maven</url>
</repository>

Usage

The user manual has been moved to the wiki

What's new?

For the full list of what's new see [this wiki page] (https://github.com/dnvriend/akka-persistence-jdbc/wiki/Version-History).

1.2.0-RC2 (2015-09-07)

  • Compatibility with Akka 2.4.0-RC2
  • No obvious optimalizations are applied, and no schema refactorings are needed (for now)
  • Please note; schema, serialization (strategy) and code refactoring will be iteratively applied on newer release of the 2.4.0-xx branch, but for each step, a migration guide and SQL scripts will be made available.
  • Use the following library dependency: "com.github.dnvriend" %% "akka-persistence-jdbc" % "1.2.0-RC2"
  • Fully backwards compatible with akka-persistence-jdbc v1.1.7's schema and configuration

1.1.8 (2015-09-04)

  • Compatibility with Akka 2.3.13
  • Akka 2.3.12 -> 2.3.13