akkadotnet / Akka.Persistence.Sql

Linq2Db implementation of Akka.Persistence.Sql. Common implementation for SQL Server, Sqlite, Postgres, Oracle, and MySql.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update Journal event deletion behavior

Arkatufus opened this issue · comments

This is a discussion thread over how journal event deletion should behave in Linq2Db.

In the current code as of November 2022, Linq2Db is still supporting event journal logical delete operation and offers queries over deleted events.

Logical deletion support has been removed from our other SQL plugins and have been removed from the latest JVM codes, I strongly believe that we should also do the same with Linq2B as it will make the plugin settings less confusing for users.

commented

IIRC when I originally ported things over, persistence-jdbc still had logical deletes as an option but marked 'will be removed in next major release'

So, if we want to get rid of it that makes sense, as long as there's no demand for it.

Do note that (at least last I checked) the IsDeleted column is still utilized for 'hard' deletes in native jvm; that's how they get around the need for a JournalMetadata table (just keep the last column in DB with IsDeleted=1)

The only 'devils advocate' though I have in favor of keeping soft deletes, is that it can be used as a form of runtime optimization (where a background job cleans up the unneeded soft delete records rather than having them cleared in the plugin) but that feels a bit extreme even for my taste.

That is correct, the deleted column will still be there, the only difference will be the removal of the logical-delete option in the HOCON config. By doing this, we can make journal query a lot simpler without having to include include-deleted flag. All of journal queries can be turned into pre-compiled queries that should improve read speed/throughput even more.

Yeah I don't think we should allow the user to specify what type of delete they want - the plugin should just do what it thinks is best.

Implemented in #124