Coder Social home page Coder Social logo

Comments (10)

jexp avatar jexp commented on August 23, 2024 1

Regarding events it would be good to see what is used by other db's with kafka or eg debezium. I have a call with the latter on Monday

from neo4j-streams.

jexp avatar jexp commented on August 23, 2024

You mean for async execution? I actually want to move to Kotlin co-routines.

from neo4j-streams.

conker84 avatar conker84 commented on August 23, 2024

I made this, If you think that is a good starting point, I can reimplement it with co-routines. Sorry but I didn't know them until now!

from neo4j-streams.

jexp avatar jexp commented on August 23, 2024

I like it but we might want to make it configurable.
Also we need to be careful esp. with data that has been deleted (changed) if you access it outside of the current tx you will either not see it anymore (if the tx has been commited) or not see it yet (if data has just been created).

So the read from the graph will have to happen in the current tx only the publication could be async.

Also after discussing with Omar, I was thinking about changing the published record from being a simple data record to something more like an event, with { meta, audit, operation, previous, current }
at least as an option.

from neo4j-streams.

conker84 avatar conker84 commented on August 23, 2024

Great! Just a question because I want to better understand how the trigger management works. Consider this scenario:

  1. Some data is created;
  2. The Kafka module broadcast the data to consumers in the beforeCommit method;
  3. Another Trigger for some reason, maybe one that provide a graph data model validation, rolled back the data; (or even the database crashes)

Is this a possibile scenario?

I think that the switch to the event is better!

from neo4j-streams.

conker84 avatar conker84 commented on August 23, 2024

ping :)

from neo4j-streams.

jexp avatar jexp commented on August 23, 2024

Hey sorry.
We can create the events in beforeCommit but then create a marker that we return and check it it aftercommit/afterrollback and in case of rollback put a negating/cancellation event on the stream

from neo4j-streams.

conker84 avatar conker84 commented on August 23, 2024

Hi @jexp ,
I checked the co-routines and seems they are an experimental feature.
Maybe at this point it is better to use the runnables?

from neo4j-streams.

jexp avatar jexp commented on August 23, 2024

Co-Routines have been along for a long time and should be quite stable.
So I would try to use those.

from neo4j-streams.

conker84 avatar conker84 commented on August 23, 2024

Perfect!

from neo4j-streams.

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.