Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Graph : newbie questions about deployment and debugging Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Graph : newbie questions about deployment and debugging

    Hi,

    The Neo4j / Spring Data Graph combination looks wonderful, but I'm confused about a few really basic things:

    Doubts --
    1. Despite having a REST interface, you cannot in fact load a *.war file into Neo4j, correct? nor can you intercept REST calls somehow and add your own functionality?
    2. Instead, Spring Data Graph is deployed into an App Server (eg., Jetty), correct?
    3. A web application, with Spring Data Graph, can embed a local Neo4j, but can alternatively talk to one across a network, correct?
    4. If I talk to Neo4j across a network, I lose all capability of ACID transactions, correct?
    Questions --
    1. If I'm right about the above, then, is there a tutorial/example that'll help me deploy the Good Relationships The Spring Data Graph Guide Book reference project to TomCat or Glassfish?
    2. Is it possible to have a RESTful interface with Spring Data Graph? Any links to tutorial/example?
    3. Finally, I was once shown Spring Framework being unit tested and debugged directly inside Eclipse. Can anyone point me at a tutorial for doing that same thing with Spring Data Graph?

    I'd really appreciate some guidance on the above.

    Thanks.
    Hasan

    (You have my apology if I should preferably address some of this to the Neo4j forums.)

  • #2
    Continuing exploring, I've answered my own first question.

    Although one can't install a war file, Server Plugins and Unmanaged JAXRS Extensions are just what I was looking for.

    (I found documentation for that here ${unZipDir}/neo4j/examples/java/server/site/index.html)

    Am I correct that ACID transactions are possible when handled in an extension?

    Comment


    • #3
      Originally posted by HasanB View Post
      Hi,
      Doubts --
      1. Despite having a REST interface, you cannot in fact load a *.war file into Neo4j, correct? nor can you intercept REST calls somehow and add your own functionality?
        Correct, as you already found out this is supported by Server Extensions and Plugins, there is explicit support and also a small documentation example for writing an Server Extension with Spring Data Graph.
      2. Instead, Spring Data Graph is deployed into an App Server (eg., Jetty), correct?

        See above.
      3. A web application, with Spring Data Graph, can embed a local Neo4j, but can alternatively talk to one across a network, correct?
        You can have three, either SDG being part of the Neo4j Server as extension providing high performance, or SDG using an embedded Neo4j instance inside any app-server or lastly (and least performant by now) SDG running against the REST API of a generic Neo4j server.
      4. If I talk to Neo4j across a network, I lose all capability of ACID transactions, correct?
        Each request is handled in its own TX, the Neo4j team is currently working on some additonal solutions (i.e. batching of requests) but from an architectural perspective it would be better to write a server extension that talks your domain, your use-cases and the request granularity you need in your app. So talking a domain oriented protocol over (probably) REST to your server extension would give you the highest benefits (if you want to separate server & webapp).
      Questions --
      1. If I'm right about the above, then, is there a tutorial/example that'll help me deploy the Good Relationships The Spring Data Graph Guide Book reference project to TomCat or Glassfish?
        The example uses an embedded Neo4j instance. It is packaged as an war an can easily run inside any appserver. The code is on github http://github.com/jexp/cineasts
      2. Is it possible to have a RESTful interface with Spring Data Graph? Any links to tutorial/example?
        As you can embed SDG in any REST framework this shouldn't be any problem, if you want to go with a Neo4j-Server extension you can look at the sample in the docs. Otherwise it is just pulling in Jersey and SDG as dependencies, writing some Resource classes annotating them with @Resource, @Path and the methods with @Get, @Consumes, @Produces and registering them with Jersey in your web.xml. But putting up an example for that is a good idea. Thanks.
      3. Finally, I was once shown Spring Framework being unit tested and debugged directly inside Eclipse. Can anyone point me at a tutorial for doing that same thing with Spring Data Graph?

        Hmm, what do you mean by that? You can unit-test and debug SDG as every other Java project? The aspects are compiled in and eclipse, STS and IDEA can jump into the aspect source code w/o problems.

      Yes, you're right ACID TX are supported (and needed) for server extensions/plugins.

      Thank you

      Michael

      Comment


      • #4
        Dear Mr. Hunger
        Thank you very much for your help with this. I was afraid my message had fallen too far off the top of the stack.
        Despite having a REST interface, you cannot in fact load a *.war file into Neo4j, correct? nor can you intercept REST calls somehow and add your own functionality?
        Correct, as you already found out this is supported by Server Extensions and Plugins, there is explicit support and also a small documentation example for writing an Server Extension with Spring Data Graph.
        Can you tell me where to find that, please?
        A web application, with Spring Data Graph, can embed a local Neo4j, but can alternatively talk to one across a network, correct?
        You can have three, either SDG being part of the Neo4j Server as extension providing high performance, or SDG using an embedded Neo4j instance inside any app-server or lastly (and least performant by now) SDG running against the REST API of a generic Neo4j server.
        That's great! While thinking that a SpringDataGraph extension for Neo4j would be great, but unable to find out if there were such a thing, I stumbled onto the Tinkerpop suite. Do you have any sort of capabilities comparison between Neo4j embedded in SDG vs. Rexster / Neo4j? The Tinkerpop abstraction layer that permits graph DBs other than Neo4j seems like a good idea, but I wonder what one loses with having only the lowest common denominator.
        If I talk to Neo4j across a network, I lose all capability of ACID transactions, correct?
        Each request is handled in its own TX, the Neo4j team is currently working on some additonal solutions (i.e. batching of requests) but from an architectural perspective it would be better to write a server extension that talks your domain, your use-cases and the request granularity you need in your app. So talking a domain oriented protocol over (probably) REST to your server extension would give you the highest benefits (if you want to separate server & webapp).
        I had come to that conclusion, and was considering writing my own Neo4j extension when I encountered Tinkerpop.
        Is it possible to have a RESTful interface with Spring Data Graph? Any links to tutorial/example?
        As you can embed SDG in any REST framework this shouldn't be any problem, if you want to go with a Neo4j-Server extension you can look at the sample in the docs. Otherwise it is just pulling in Jersey and SDG as dependencies, writing some Resource classes annotating them with @Resource, @Path and the methods with @Get, @Consumes, @Produces and registering them with Jersey in your web.xml. But putting up an example for that is a good idea. Thanks.
        Is that the same example you mention above?
        Finally, I was once shown Spring Framework being unit tested and debugged directly inside Eclipse. Can anyone point me at a tutorial for doing that same thing with Spring Data Graph?
        Hmm, what do you mean by that? You can unit-test and debug SDG as every other Java project? The aspects are compiled in and eclipse, STS and IDEA can jump into the aspect source code w/o problems.
        As they grow in size and number of dependencies, Spring Framework projects tend to develop a tiresome loop time from fixing a bug, to compiling, building, deploying and retesting. A few years ago I saw a demo in a conference of how to load all of Spring into Eclipse, such that one could debug & test directly, skipping most of that onerous loop. I wonder if you can point to a tutorial that explains how to set that up?

        Comment


        • #5
          Tinkerpop abstracts the graph databases, adds its own functionality and introduces an layer of indirection. There are pro's and con's using it, its current Object mapping approach (Frames) works with Java dynamic Proxies so perhaps is not the best fit. You can of course also look into other language bindings.

          Regarding the Server Extension/REST example. A quite short intro in the SDG docs is here, the Neo4j-Server-Extension docs are here.

          By putting up an example I mean really creating a code project that does this.

          I can't really follow you with the Spring Framework Testing loops? If it is only about redeployment you might perhaps look into jrebel which safes a lot of that pain. Otherwise perhaps you can point me to that conference demo.

          Cheers

          Michael

          Comment

          Working...
          X