Re: [Neo4j] Solve a problem using neo4j

2011-02-08 Thread Jim Webber
Hi John,

There's nothing authoritative that I can find right now, but I'm going to be 
blogging about this in the weeks to come, starting with HA and sharding.

Jim
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Solve a problem using neo4j

2011-02-08 Thread yehohan...@googlemail.com
Thanks Tobias, is there any architecture document giving a high level view of 
how various components in neo4j interact with each other and the 
responsibilities of each component?  


John

-Original Message-
From: Tobias Ivarsson
Sent:  08/02/2011 10:39:59
Subject:  Re: [Neo4j] Solve a problem using neo4j

Hi John,

The High Availability implementation of Neo4j behaves in the same way.

Reads in HA are done from the local store.

An interesting side effect of this is that while all instances in a HA
cluster will store the same data, they can each have a different dataset in
cache. This can, with some consistent request routing, be used for what we
call "cache sharding".

-tobias

On Tue, Feb 8, 2011 at 10:10 AM, yehohan...@googlemail.com <
yehohan...@gmail.com> wrote:

> Hello Jim,
> To add to the previous question about lazy loading, how does highavailable
> implementation of neo4j behave?
>
> John
>
> Sent from my Nokia phone
> -Original Message-
> From: Jim Webber
> Sent:  08/02/2011 09:16:36
> Subject:  Re: [Neo4j] Solve a problem using neo4j
>
> Hi Ori,
>
> > 1. About the iterator - if I get a large amount of results (millions)  it
> > cannot be held in memory. Does the iterator work on in-memory collection,
> or
> > there is something like JDBC fetch size?
>
> For the embedded case, iterators are lazy so you won't hurt yourself. For
> the REST API results of traversers are built up in memory so you can hurt
> yourself.
>
> > 2. Is there an example for what I'm looking for or can someone give
> pseudo
> > code example for #3?
>
> That's pretty domain specific. But I found that looking at the Social
> Network example gave me enough understanding of the simple traverser API to
> get going:
>
> http://blog.neo4j.org/2009/09/social-networks-in-database-using-graph.html
> http://components.neo4j.org/neo4j-examples/1.2-SNAPSHOT/social-network.html
>
> Jim
>
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Tobias Ivarsson 
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Solve a problem using neo4j

2011-02-08 Thread Tobias Ivarsson
Hi John,

The High Availability implementation of Neo4j behaves in the same way.

Reads in HA are done from the local store.

An interesting side effect of this is that while all instances in a HA
cluster will store the same data, they can each have a different dataset in
cache. This can, with some consistent request routing, be used for what we
call "cache sharding".

-tobias

On Tue, Feb 8, 2011 at 10:10 AM, yehohan...@googlemail.com <
yehohan...@gmail.com> wrote:

> Hello Jim,
> To add to the previous question about lazy loading, how does highavailable
> implementation of neo4j behave?
>
> John
>
> Sent from my Nokia phone
> -Original Message-
> From: Jim Webber
> Sent:  08/02/2011 09:16:36
> Subject:  Re: [Neo4j] Solve a problem using neo4j
>
> Hi Ori,
>
> > 1. About the iterator - if I get a large amount of results (millions)  it
> > cannot be held in memory. Does the iterator work on in-memory collection,
> or
> > there is something like JDBC fetch size?
>
> For the embedded case, iterators are lazy so you won't hurt yourself. For
> the REST API results of traversers are built up in memory so you can hurt
> yourself.
>
> > 2. Is there an example for what I'm looking for or can someone give
> pseudo
> > code example for #3?
>
> That's pretty domain specific. But I found that looking at the Social
> Network example gave me enough understanding of the simple traverser API to
> get going:
>
> http://blog.neo4j.org/2009/09/social-networks-in-database-using-graph.html
> http://components.neo4j.org/neo4j-examples/1.2-SNAPSHOT/social-network.html
>
> Jim
>
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Tobias Ivarsson 
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Solve a problem using neo4j

2011-02-08 Thread yehohan...@googlemail.com
Hello Jim,
To add to the previous question about lazy loading, how does highavailable 
implementation of neo4j behave?

John

Sent from my Nokia phone
-Original Message-
From: Jim Webber
Sent:  08/02/2011 09:16:36
Subject:  Re: [Neo4j] Solve a problem using neo4j

Hi Ori,

> 1. About the iterator - if I get a large amount of results (millions)  it
> cannot be held in memory. Does the iterator work on in-memory collection, or
> there is something like JDBC fetch size?

For the embedded case, iterators are lazy so you won't hurt yourself. For the 
REST API results of traversers are built up in memory so you can hurt yourself. 

> 2. Is there an example for what I'm looking for or can someone give pseudo
> code example for #3?

That's pretty domain specific. But I found that looking at the Social Network 
example gave me enough understanding of the simple traverser API to get going:

http://blog.neo4j.org/2009/09/social-networks-in-database-using-graph.html
http://components.neo4j.org/neo4j-examples/1.2-SNAPSHOT/social-network.html

Jim


___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Solve a problem using neo4j

2011-02-08 Thread Jim Webber
Hi Ori,

> 1. About the iterator - if I get a large amount of results (millions)  it
> cannot be held in memory. Does the iterator work on in-memory collection, or
> there is something like JDBC fetch size?

For the embedded case, iterators are lazy so you won't hurt yourself. For the 
REST API results of traversers are built up in memory so you can hurt yourself. 

> 2. Is there an example for what I'm looking for or can someone give pseudo
> code example for #3?

That's pretty domain specific. But I found that looking at the Social Network 
example gave me enough understanding of the simple traverser API to get going:

http://blog.neo4j.org/2009/09/social-networks-in-database-using-graph.html
http://components.neo4j.org/neo4j-examples/1.2-SNAPSHOT/social-network.html

Jim


___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Solve a problem using neo4j

2011-02-07 Thread Ori
Hi,

Thanks for your answer. I have several more questions:
1. About the iterator - if I get a large amount of results (millions)  it
cannot be held in memory. Does the iterator work on in-memory collection, or
there is something like JDBC fetch size?
2. Is there an example for what I'm looking for or can someone give pseudo
code example for #3?

Thanks,
Ori

On Mon, Feb 7, 2011 at 6:04 PM, Jim Webber  wrote:

> Hi Ori,
>
> To answer your overall question: yes Neo4j is (generally speaking) a good
> fit for this kind of exercise.
>
> To answer your specific questions:
>
> 1. The results you get back from the APIs are iterable, so you can "page"
> through them at whatever pace you like.
> 2. Since you're writing JVM code when you query your graph in Neo4j, you
> can filter nodes that you want in your result set as part of your traversal
> description.
> 3. This is a harder algorithm (essentially a recommendation algorithm) but
> again it is very compatible with Neo4j (we have customers doing similar
> things in production).
>
> Don't hesitate to ask more questions on the list if you need more advice,
> it's a very friendly community.
>
> Jim
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Solve a problem using neo4j

2011-02-07 Thread Jim Webber
Hi Ori,

To answer your overall question: yes Neo4j is (generally speaking) a good fit 
for this kind of exercise.

To answer your specific questions:

1. The results you get back from the APIs are iterable, so you can "page" 
through them at whatever pace you like.
2. Since you're writing JVM code when you query your graph in Neo4j, you can 
filter nodes that you want in your result set as part of your traversal 
description.
3. This is a harder algorithm (essentially a recommendation algorithm) but 
again it is very compatible with Neo4j (we have customers doing similar things 
in production).

Don't hesitate to ask more questions on the list if you need more advice, it's 
a very friendly community.

Jim
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Solve a problem using neo4j

2011-02-07 Thread Ori
Hi,

I wanted to ask a general question, and to know if Neo4j can help to solve
it.

I have data that can be represented in a graph:
1. Objects of type A
2. Relations from A to A
3. Objects of type B
4. Relations from B to B
5. Relations from A to B

Each table has between 20,000 and 50,000 records.

Currently I'm using a DB and the queries run slow. I can hold redundant data
to make specific queries run faster but before I do that I wanted to know if
a graph db may help.
I want to be able to do the following queries:
1. The first 50 joined results of A->B (including all A's and B's in the
hierarchy), with paging ability (50 records at a time)
2. Give the same query as (1) but with a filter for A, or B or both
3. Give statistics for A's with the top number of B's (again it does not
matter if A is related to B directly or through more A's and B's)

If it is possible to do 1-3 then I guess the rest of my requirements will be
covered.

Can someone help, or give me a name of another tool?

Thanks,
Ori
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user