akka / akka-persistence-jdbc

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

Home Page:https://doc.akka.io/docs/akka-persistence-jdbc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document which DB dialects support durable state store

johanandren opened this issue · comments

And how to configure them for that.

Sister ticket to akka/akka#30857

I'm not entirely sure about this myself, we only have durable state schema for Postgres so far AFAICS

It's only implemented for Postgres so far.

Hi guys,

the durable state store is very interesting new feature in akka framework.

I have tried it with Postgres and it works fine.

I would like to keep customer deployments as simple as possible so I would like to embed the used database in my application. I tried using using Apache Derby and H2 database, but like you say they do not seem to be supported for durable state. Embedded (in-mem) db would also be easier to use in unit tests (no need for docker).

Are there any plans to add support for any other databases than Postgres? Any embeddable dbs in the pipeline?

@patriknw What exactly needs to be added to support a db? Could a developer add the support themselves (for example extend some critical piece of code) or are the changes needed in the akka code?

If you feel like this is the wrong place for this question, I can create an issue someplace else.

Thanks!

Hi @hirsivaja , the changes needed are only here in the akka-persistence-jdbc plugin. A bit of work for each supported database, hard to say exactly how much (as usual with software). If you would like to contribute durable state support for a specific database dialect is definitely welcome!

Thanks for the quick response.

I know so little about akka internal architecture that it would be quite impossible for me to fix this on my own.
I can see from the code in DurableStateQueries.scala that some effort to support H2 has been taken already. Hopefully at some point in time you guys will have a chance to finish the work.

In the mean time I have plenty of other options. For example I can continue using the Event Sourcing. Even though in my use case the Durable State would fit better as I am only interested in the final state, the Event Sourcing is fine too.

Hi @johanandren,

I looked into this a little bit more. Seems like it might work after all.
Earlier I was using H2 version 2.0.202 and got some errors.

But when using the same H2 version as in

"com.h2database" % "h2" % "1.4.200",

I could persist some data.

I was trying to check your documentation but did not see any mention about which version of the databases to use.