[Neo] Neo in a cluster?

Raul Raja Martinez raulraja at gmail.com
Sat Jan 2 01:09:09 CET 2010


Hi Peter,

Yes we looked at jo4neo and found it very interesting and it probably suits
most people use cases.
In our particular case these are the reasons why we didn't choose it.

1. jo4neo is tightly couple to neo4j, our implementation is based on neo4j
but the interface impls are defined so that they can be swapped for other
graph based storage in case we decide to not use neo4j in some other
project.

2. Our implementation never handles transactions directly, jo4neo does.
jo4neo does not allow control over transactions and creates a transaction
per operation
http://jo4neo.googlecode.com/svn/trunk/jo4neo/src/main/java/jo4neo/DeleteOpertation.java

For a webapp we provide a filter that wraps the request in a transaction,
allowing to groups operations, and we also plan to support Callbacks that
allow you to group operations ina  transactional context. We also integrate
with Spring and we are working on the @Transactional support

3. jo4neo loads all properties for a bean even when these are not queried or
used. We enforce the use of interfaces not beans and we create a dynamic
proxy that implements the interface so that calls to properties and
relationships are proxied and delegated to the underlying nodes without the
need to use reflection. So when you load a Object by id nothing we do not
load all its properties or relationships unless you use them, and even when
you use them they don't get cached in the proxy so it saves memory. We trust
that neo4j caches the nodes and properties that are used the most.

As far as JPA is concerned... Yes and No. I think you'd gain more acceptance
if you implement JPA, on the other hand the JPA spec pretty much assumes the
storage is based on a relational database, they say... The Java Persistence
API deals with the way relational data is mapped to Java objects
("persistent entities"), the way that these objects are stored in a
relational database so that they can be accessed at a later time, and the
continued existence of an entity's state even after the application that
uses it ends. In addition to simplifying the entity persistence model, the
Java Persistence API standardizes object-relational mapping.

So I'd be great to have a partial JPA impl for basic querying and
annotations but neo4j approach to persistence is much more flexible and not
constrained by the relational model.

2010/1/1 Peter Neubauer <peter.neubauer at neotechnology.com>

> Raul,
> thanks for the info! Have you looked at Taylor's jo4neo,
> http://code.google.com/p/jo4neo/ which is taking a similar approach,
> and do you think there would be value in having a JPA adapter for
> Neo4j? We would be happy to hear about your experience there!
>
> Happy New Year!
>
> /peter neubauer
>
> COO and Sales, Neo Technology
>
> GTalk:      neubauer.peter
> Skype       peter.neubauer
> Phone       +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter      http://twitter.com/peterneubauer
>
> http://www.neo4j.org                - Relationships count.
> http://gremlin.tinkerpop.com    - PageRank in 2 lines of code.
> http://www.linkedprocess.org   - Computing at LinkedData scale.
>
>
>
> On Thu, Dec 31, 2009 at 10:53 PM, Raul Raja Martinez <raulraja at gmail.com>
> wrote:
> > Hi Johan,
> >
> > It does and we're very excited about Neo4j. Can't wait for your
> clustering
> > support.
> > We have developed a annotation based sytem on top of Neo based on
> interfaces
> > and java dynamic proxies  that allows you to delegate all state lookup
> and
> > relationship to the neo store such as....
> >
> > @Node
> > public interface Person {
> >
> >  @Id
> >  Long getId();
> >
> >  @Property(indexed=true,unique=true,fulltext=true)
> >  String getName();
> >
> >  void setName(String name);
> >
> >  @Relationship
> >  City getCity();
> >
> >  @Relationship
> >  List<Person> getFriends();
> >
> >  @Traverser(returnableEvaluator=Whatever.class)
> >  List<Person> getAllFriendsCloseBy();
> > ....
> > }
> >
> > It's lazy lookup based system that wraps the underlying nodes and
> delegates
> > calls to the right operations on the node. It supports Date, Enums and
> any
> > arbitrariy types that can be configured through converters. We're going
> to
> > run it in a prod system in the next few months and plan to release it
> open
> > source.
> >
> > We have extensive experience with hibernate, and other jpa based
> > implementations and the ease of use and speed with neo4j so far is better
> > when it comes to complex relaationships or operation that require
> multiple
> > joins in a fully normalized relational model.
> >
> > Our current challenge is returning ordered relationships when displaying
> the
> > data since it requires the node/entities returned in a specific order
> based
> > on node property values.
> >
> > Anyway thanks for your responses and good job with Neo4J
> >
> > 2009/12/31 Johan Svensson <johan at neotechnology.com>
> >
> >> Hi,
> >>
> >> On Wed, Dec 30, 2009 at 5:07 PM, Raul Raja Martinez <raulraja at gmail.com
> >
> >> wrote:
> >> > Hi everybody,
> >> >
> >> > We're evaluating neo4j and we're very pleased with it so far.
> >> >
> >> > I have a few questions/concerns as far as it scalability beyond a
> single
> >> > machine.
> >> >
> >> > 1. Can a Neo4J store be accessed from different machines? I'm aware of
> >> > remote neo but I read I'd be slow a in a production environment.
> >>
> >> Yes. Our solution for this (HA 1.0) is currently in development but if
> >> you just need availability and scaling reads you can either roll your
> >> own solution or make use of read-only Neo4j instances and
> >> online-backup (alpha) http://wiki.neo4j.org/content/Online_Backup_HA
> >>
> >> >
> >> > 2. If it can, what would the WRITE/READ model look like? Is there the
> >> > concept of master/slave clustered stores
> >>
> >> HA 1.0 will have a master/slave setup but all slaves can be written
> >> to. Writes will be synchronized with the master and the master will
> >> then eventually make sure other slaves gets updated.
> >>
> >> >
> >> > 3. Is there Terracotta support or has anybody ever looked into in?
> >>
> >> No support for Terracotta and we have not really looked into it (but
> >> from what I remember everything breaks down once you need to be a real
> >> database and not just a "cache").
> >>
> >> >
> >> > 4. Are there plans to support clustering in Neo4j? If so is there a
> road
> >> > map?
> >> >
> >> > I think it is realistic to assume that many server side projects that
> >> > support multiple concurrent users run in production with more than one
> >> J2EE
> >> > server even if it is for balancing http load. It is still unclear to
> me
> >> how
> >> > to get data from a neo store if the front end is distributed among
> >> servers.
> >>
> >> Right now we are fully focused on the Neo4j 1.0 release that will be
> >> out in January. After that focus will shift to HA 1.0 and we aim to
> >> get a first version out in Q1/Q2. Since we are an embedded database
> >> the architecture when running multiple machines is a bit different
> >> then from the typical J2EE setup. Instead of having your separate DB
> >> cluster machines put the full stack on each machine (http layer+BL+DB
> >> layer) and run a load balancer in front.
> >>
> >> Hope this answers some of your questions.
> >>
> >> Regards,
> >> -Johan
> >> _______________________________________________
> >> Neo mailing list
> >> User at lists.neo4j.org
> >> https://lists.neo4j.org/mailman/listinfo/user
> >>
> >
> >
> >
> > --
> > Raul Raja
> > _______________________________________________
> > Neo mailing list
> > User at lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Raul Raja


More information about the User mailing list