Git Product home page Git Product logo

Comments (10)

Arkatufus avatar Arkatufus commented on June 2, 2024 1

This would not be a problem if we remove the logical-delete and include-deleted flag from the HOCON settings. The fake entry would not be read during recovery and query operation because it is marked as deleted. It will break thing if users are actually reading the journal table directly though.

from akka.persistence.sql.

Aaronontheweb avatar Aaronontheweb commented on June 2, 2024

cc @to11mtm

from akka.persistence.sql.

to11mtm avatar to11mtm commented on June 2, 2024

@Aaronontheweb So this is one of the many vaunted compatibility mode switches 😅

  • The way JVM/Linq2Db do things is better because it minimizes the total number of pages written on commit.
    • Also, it's one less page being read on read.
  • FWIW, Persistence.Linq2db -should- be able to handle both.
    • but to be clear it's kinda gnarly code, and there may be some edge cases around 'converting' to the JVM method.

I can say from experience that Linq2Db/JVM's approach handles frequent deletes -much- better than Sql.Common's JournalMetadata paradigm on MSSQL.

https://github.com/akkadotnet/Akka.Persistence.Linq2Db/blob/dev/src/Akka.Persistence.Sql.Linq2Db/persistence.conf#L23 <-- Switch

https://github.com/akkadotnet/Akka.Persistence.Linq2Db/blob/dev/src/Akka.Persistence.Sql.Linq2Db/Journal/DAO/BaseByteArrayJournalDao.cs#L385 <-- Compat Mode Query

https://github.com/akkadotnet/Akka.Persistence.Linq2Db/blob/dev/src/Akka.Persistence.Sql.Linq2Db/Journal/DAO/BaseByteArrayJournalDao.cs#L373 <-- JVM-style Native Query

We also handle it on the actual Delete of course, but the logic is a bit uglier.

This may or may not be another migration step to consider, or making this compat flag ternary for better forward-compatibility.

from akka.persistence.sql.

Aaronontheweb avatar Aaronontheweb commented on June 2, 2024

Thanks @to11mtm - this is very helpful. This issue was mostly created as a discussion point so we can reason about the backwards compat specs and what to do going forward.

from akka.persistence.sql.

to11mtm avatar to11mtm commented on June 2, 2024

Thanks @to11mtm - this is very helpful. This issue was mostly created as a discussion point so we can reason about the backwards compat specs and what to do going forward.

For sure; it's also worthwhile to have some level of documentation (even if it's in this issue) around the overall rationale for the change.

Realistically, a 'seamless' migration would require at minimum a migration script; the 'tricky' thing is that we would need some 'fake' event to put into the journal tables based on migration.

I suppose the other option would be the aforementioned ternary; it would at least minimize pain on 'new' persistenceIds (as they would elide at least the writes to Metadata) but would still have a read check+union (although, if metadata is properly indexed, should be fast to see it's not there.)

from akka.persistence.sql.

Aaronontheweb avatar Aaronontheweb commented on June 2, 2024

This would not be a problem if we remove the logical-delete and include-deleted flag from the HOCON settings. The fake entry would not be read during recovery and query operation because it is marked as deleted. It will break thing if users are actually reading the journal table directly though.

Any reason we shouldn't do this @to11mtm ? I think this approach makes a lot of sense.

from akka.persistence.sql.

Arkatufus avatar Arkatufus commented on June 2, 2024

My take is that we'll be implementing both model, but the metadata table will only be supported on a legacy system?
We will need to clean up the HOCON configuration for linq2db, its a bit too convoluted right now, especially with the addition of TagTable

from akka.persistence.sql.

Aaronontheweb avatar Aaronontheweb commented on June 2, 2024

@Arkatufus was this resolved in yesterday's PR? #145

from akka.persistence.sql.

to11mtm avatar to11mtm commented on June 2, 2024

@Aaronontheweb @Arkatufus Can we close this?

from akka.persistence.sql.

Aaronontheweb avatar Aaronontheweb commented on June 2, 2024

@to11mtm yep!

from akka.persistence.sql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.