MENU +44 (0) 333 44 GRAPH

GraphAware Blog

GraphAware Neo4j ChangeFeed

27 Aug 2014 by Luanne Misquitta

In this post, we’d like to introduce the first version of the GraphAware Neo4j ChangeFeed - a GraphAware Runtime Module that keeps track of changes made to the graph.

GraphAware ChangeFeed Module

Every time a transaction commits successfully, all changes made to the graph as a result of the transaction are recorded as a change set. A change includes additions, modifications and deletions of nodes, relationships, labels, and properties. Each change set has a UUID, a set of changes that occurred in the same transaction, and a timestamp which is allocated at the time the transaction starts committing.

The module can be configured to limit the total number of changes tracked, and prune the feed at specified intervals. Please see Setup and Configuration for more information.

Usage

In Server Mode, the ChangeFeed is accessible via a REST API.

Issue GET requests to http://your-server-address:7474/graphaware/changefeed/{moduleId}

to get a list of changes made to the graph. The most recent change appears first. Request parameter limit specifies the maximum number of changes to return. The other request parameter uuid specifies the UUID of the last change set the client has seen, only changes later than this are returned.

A sample of the JSON returned looks like

[
    {
        "uuid": "205d3e90-2ea9-11e4-b439-14109fecc604",
        "timestamp": 1409226465529,
        "changes": [
            "Deleted node (:Person {name: Luanne})",
            "Deleted node (:Person {name: Michal})",
            "Deleted node (:Company {name: GraphAware})",
            "Deleted relationship (:Person {name: Michal})-[:WORKS_FOR]->(:Company {name: GraphAware})",
            "Deleted relationship (:Person {name: Luanne})-[:WORKS_FOR]->(:Company {name: GraphAware})"
        ]
    },
    {
        "uuid": "2045bef0-2ea9-11e4-b439-14109fecc604",
        "timestamp": 1409226465375,
        "changes": [
            "Created relationship (:Person {name: Michal})-[:WORKS_FOR]->(:Company {name: GraphAware})",
            "Created relationship (:Person {name: Luanne})-[:WORKS_FOR]->(:Company {name: GraphAware})"
        ]
    },
    {
        "uuid": "1ff506e0-2ea9-11e4-b439-14109fecc604",
        "timestamp": 1409226464846,
        "changes": ["Created node (:Company {name: GraphAware})"]
    }
]

The Java API exposes similar functionality, please refer to the documentation.

Next Steps

Changes in a change set are human rather than machine readable, future versions will address this. We’d also like to have more configuration and filters to specify what should be tracked. Do give the first version a try - your feedback and suggestions are very welcome!

Share this blog post:

+1 LinkedIn
comments powered by Disqus

Popular

Recent

Posts by tag

Neo4j Conference NoSQL Czech Beginner Analytics Advanced Modelling Meetup GraphAware Intermediate GraphUnit Testing Transactions Cypher Events Spring SDN OGM Recommendations Search Elasticsearch Security Enterprise NLP HCM PeopleAnalytics HR HRTech Framework Internationalization Localization

Search this blog