[Neo] Fwd: Performance question

Tobias Ivarsson tobias.ivarsson at neotechnology.com
Wed Apr 21 15:57:29 CEST 2010

On Wed, Apr 21, 2010 at 2:56 PM, Atle Prange <atle.prange at gmail.com> wrote:

> I got the same thing:
> Here is my answer to your post:
>        I agree with you completely, and i am trying to get the best of
>        both worlds. Maybe bytecode manipulation is the only way to
>        go....
>        But are you in fact saying that i am implementing an
>        antipattern, and both jo4neo and neo-persistence use the same
>        antipattern?
I assume the pattern you are referring to is the load/store pattern. I
wouldn't say that it is an anti-pattern, for neo-persistence (worst name
ever) it is a very valid pattern, since the goal of that component is to
implement the Java Persistence API (JPA) on Neo4j. For jo4neo it's the way
it needs to be done because of the way it wants to represent state.

However, the delegating software transactional memory object mapping model
that we advocate for representing objects, that Anders mentioned earlier in
this thread, gives you good performance and is easy and convenient to work
with. It would be interesting if you could take that approach instead, since
jo4neo already fulfills the load/store usecase, but if you have ideas that
will make your load/store based system better than jo4neo in some aspect, I
don't want to get in your way, I think you should explore those ideas. I am
looking forward to hearing about your results.

>        A related question on performance. When fetching relations from
>        a node using Node.getRelatioships(RelationshipType...types), is
>        the node loading all relationships, and the collecting all of
>        the given types, or are just the matching relationships loaded?

With the current implementation the answer is "something inbetween", Neo4j
will look at relationships of more types, but only the ones of the specified
types are actually loaded. This will change in an upcoming version to only
look at the relationships of the actual specified types.

Tobias Ivarsson <tobias.ivarsson at neotechnology.com>
Hacker, Neo Technology
Cellphone: +46 706 534857

More information about the User mailing list