All Projects → okumin → Akka Persistence Sql Async

okumin / Akka Persistence Sql Async

Licence: apache-2.0
A journal and snapshot store plugin for akka-persistence using RDBMS.

Programming Languages

scala
5932 projects

Projects that are alternatives of or similar to Akka Persistence Sql Async

Adminer Custom
Customizations for Adminer, the best database management tool written in PHP.
Stars: ✭ 99 (-13.91%)
Mutual labels:  mysql, postgresql
Docker Laravel
🐳 Docker Images for Laravel development
Stars: ✭ 101 (-12.17%)
Mutual labels:  mysql, postgresql
Openseedbox
OpenSeedbox - Open Source Multi-User Bittorrent Web UI
Stars: ✭ 101 (-12.17%)
Mutual labels:  mysql, postgresql
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+15698.26%)
Mutual labels:  mysql, postgresql
Bireme
Bireme is an incremental synchronization tool for the Greenplum / HashData data warehouse
Stars: ✭ 110 (-4.35%)
Mutual labels:  mysql, postgresql
Qtl
A friendly and lightweight C++ database library for MySQL, PostgreSQL, SQLite and ODBC.
Stars: ✭ 92 (-20%)
Mutual labels:  mysql, postgresql
Honeyeql
HoneyEQL is a Clojure library enables you to query database using the EDN Query Language.
Stars: ✭ 111 (-3.48%)
Mutual labels:  mysql, postgresql
Gopherus
This tool generates gopher link for exploiting SSRF and gaining RCE in various servers
Stars: ✭ 1,258 (+993.91%)
Mutual labels:  mysql, postgresql
Xgenecloud
XgeneCloud is now https://github.com/nocodb/nocodb
Stars: ✭ 1,629 (+1316.52%)
Mutual labels:  mysql, postgresql
Haproxy Configs
80+ HAProxy Configs for Hadoop, Big Data, NoSQL, Docker, Elasticsearch, SolrCloud, HBase, MySQL, PostgreSQL, Apache Drill, Hive, Presto, Impala, Hue, ZooKeeper, SSH, RabbitMQ, Redis, Riak, Cloudera, OpenTSDB, InfluxDB, Prometheus, Kibana, Graphite, Rancher etc.
Stars: ✭ 106 (-7.83%)
Mutual labels:  mysql, postgresql
Electrocrud
Database CRUD Application Built on Electron | MySQL, Postgres, SQLite
Stars: ✭ 1,267 (+1001.74%)
Mutual labels:  mysql, postgresql
Sql Kit
*️⃣ Build SQL queries in Swift. Extensible, protocol-based design that supports DQL, DML, and DDL.
Stars: ✭ 115 (+0%)
Mutual labels:  mysql, postgresql
Graphjin
GraphJin - Build APIs in 5 minutes with GraphQL. An instant GraphQL to SQL compiler.
Stars: ✭ 1,264 (+999.13%)
Mutual labels:  mysql, postgresql
Leoric
👑 JavaScript ORM for MySQL, PostgreSQL, and SQLite.
Stars: ✭ 94 (-18.26%)
Mutual labels:  mysql, postgresql
Xeus Sql
xeus-sql is a Jupyter kernel for general SQL implementations.
Stars: ✭ 85 (-26.09%)
Mutual labels:  mysql, postgresql
Csv2db
The CSV to database command line loader
Stars: ✭ 102 (-11.3%)
Mutual labels:  mysql, postgresql
Sql
MySQL & PostgreSQL pipe
Stars: ✭ 81 (-29.57%)
Mutual labels:  mysql, postgresql
Chloe
A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C#
Stars: ✭ 1,248 (+985.22%)
Mutual labels:  mysql, postgresql
Spring Boot 2.x Examples
Spring Boot 2.x code examples
Stars: ✭ 104 (-9.57%)
Mutual labels:  mysql, postgresql
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-3.48%)
Mutual labels:  mysql, postgresql

akka-persistence-sql-async

Build Status

A journal and snapshot store plugin for akka-persistence using RDBMS. Akka-persistence-sql-async executes queries by ScalikeJDBC-Async that provides non-blocking APIs to talk to databases.

Akka-persistence-sql-async supports following databases.

  • MySQL
  • PostgreSQL

This library is tested against akka-persistence-tck.

Usage

Dependency

You should add the following dependency.

libraryDependencies += "com.okumin" %% "akka-persistence-sql-async" % "0.5.1"

And then, please include the mysql-async if you use MySQL.

libraryDependencies += "com.github.mauricio" %% "mysql-async" % "0.2.20"

And if you use PostgreSQL.

libraryDependencies += "com.github.mauricio" %% "postgresql-async" % "0.2.20"

Configuration

In application.conf,

akka {
  persistence {
    journal.plugin = "akka-persistence-sql-async.journal"
    snapshot-store.plugin = "akka-persistence-sql-async.snapshot-store"
  }
}

akka-persistence-sql-async {
  journal.class = "akka.persistence.journal.sqlasync.MySQLAsyncWriteJournal"
  snapshot-store.class = "akka.persistence.snapshot.sqlasync.MySQLSnapshotStore"

  # For PostgreSQL
  # journal.class = "akka.persistence.journal.sqlasync.PostgreSQLAsyncWriteJournal"
  # snapshot-store.class = "akka.persistence.snapshot.sqlasync.PostgreSQLSnapshotStore"

  user = "root"
  password = ""
  url = "jdbc:mysql://localhost/akka_persistence_sql_async"
  max-pool-size = 4
  wait-queue-capacity = 10000

  metadata-table-name = "persistence_metadata"
  journal-table-name = "persistence_journal"
  snapshot-table-name = "persistence_snapshot"
  
  connect-timeout = 5s
  query-timeout = 5s
}

Table schema

Create the database and tables for journal and snapshot store.

MySQL

CREATE TABLE IF NOT EXISTS {your_metadata_table_name} (
  persistence_key BIGINT NOT NULL AUTO_INCREMENT,
  persistence_id VARCHAR(255) NOT NULL,
  sequence_nr BIGINT NOT NULL,
  PRIMARY KEY (persistence_key),
  UNIQUE (persistence_id)
) ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS {your_journal_table_name} (
  persistence_key BIGINT NOT NULL,
  sequence_nr BIGINT NOT NULL,
  message LONGBLOB NOT NULL,
  PRIMARY KEY (persistence_key, sequence_nr),
  FOREIGN KEY (persistence_key) REFERENCES {your_metadata_table_name} (persistence_key)
) ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS {your_snapshot_table_name} (
  persistence_key BIGINT NOT NULL,
  sequence_nr BIGINT NOT NULL,
  created_at BIGINT NOT NULL,
  snapshot LONGBLOB NOT NULL,
  PRIMARY KEY (persistence_key, sequence_nr),
  FOREIGN KEY (persistence_key) REFERENCES {your_metadata_table_name} (persistence_key)
) ENGINE = InnoDB;

PostgreSQL

CREATE TABLE IF NOT EXISTS {your_metadata_table_name} (
  persistence_key BIGSERIAL NOT NULL,
  persistence_id VARCHAR(255) NOT NULL,
  sequence_nr BIGINT NOT NULL,
  PRIMARY KEY (persistence_key),
  UNIQUE (persistence_id)
);

CREATE TABLE IF NOT EXISTS {your_journal_table_name} (
  persistence_key BIGINT NOT NULL REFERENCES {your_metadata_table_name}(persistence_key),
  sequence_nr BIGINT NOT NULL,
  message BYTEA NOT NULL,
  PRIMARY KEY (persistence_key, sequence_nr)
);

CREATE TABLE IF NOT EXISTS {your_snapshot_table_name} (
  persistence_key BIGINT NOT NULL REFERENCES {your_metadata_table_name}(persistence_key),
  sequence_nr BIGINT NOT NULL,
  created_at BIGINT NOT NULL,
  snapshot BYTEA NOT NULL,
  PRIMARY KEY (persistence_key, sequence_nr)
);

Release Notes

0.5.1 - Jan 2, 2018

  • Support connect/query timeout

0.5.0 - Nov 8, 2017

  • Update dependencies
  • Scala 2.12 support

0.4.0 - Nov 5, 2016

  • Update mysql-async and postgresql-async

0.3.1 - Oct 15, 2015

0.3.0 - Oct 7, 2015

  • Update Akka to 2.4

0.2.1 - Sep 25, 2015

0.2 - Apr 5, 2015

0.1 - Sep 30, 2014

  • The first release

License

Apache 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].