Enterprise Java

Undo feature with Neo4J & Enterprise Java

I’ve created an example how to implement an undo feature in a Quarkus application that uses a Neo4J database. From a user perspective, an undo action might look little spectacular, but once you know what needs to be taken into account on a database side, it’s everything but trivial. Especially in graph databases, we need to take the relationships into account.

In a previous video, I showed to how integrate Neo4J in a Quarkus application. This example is based on that coffee shop application.

This example is a proof of concept, a starting point on how such a feature can be implemented. The code is based on the Neo4j Streaming Data Integrations plugin, which runs in our Neo4J instance and emits Change Data Capture (CDC) data representations. In our example, we don’t stream CDC events, but rather persist the transaction data in separate :Action nodes directly in the graph, which can be used for the future undo action.

You find the source code to all examples below.

Resources

You can try out the example yourself. The following repositories contain the updated Quarkus application and the Neo4J plugin that runs in your database instance:

Happy undoing!

All opinions are my own and do not reflect those of my employer or colleagues.

Published on Java Code Geeks with permission by Sebastian Daschner, partner at our JCG program. See the original article here: Undo feature with Neo4J & Enterprise Java

Opinions expressed by Java Code Geeks contributors are their own.

Sebastian Daschner

Sebastian Daschner is a self-employed Java consultant and trainer. He is the author of the book 'Architecting Modern Java EE Applications'. Sebastian is a Java Champion, Oracle Developer Champion and JavaOne Rockstar.
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button