[Neo] [Neo4j.rb] Newbie questions

Andreas Ronge andreas.ronge at jayway.se
Mon Jul 13 17:22:45 CEST 2009


Hi

This how it works now:
> * keep all of the indexes and data in memory for speed
Yes, this is possible. But it will never be persisted to disk. When
you start the application you have to recreate the index again (which
can be time consuming ...)
> * when the server restarts, read the whole database into memory again
See the reindexing chapter in the README. There is an update_index
method on the NodeMixin that does this.
Just call that method when your application starts up.
> * asynchronously (with respect to HTTP requests) write to the
> database, say, every 15 minutes.
It is not supported but it would be really cool.
There is a problem with the current solution of indexing - the index
can get out of sync with the neo database since the lucene transaction
will be commited
just before the neo4j transaction commits. If the machine crashes just
between those two commits then you have to recreate the index again
(need two phase commit to solve this)

I'm currently working on storing all neo transaction events as nodes
so that another process/thread can read those transaction nodes and
update an index or replicating the graph.
See the example test/replication/test_master.rb and test_slave.rb
which uses the tx_tracker neo4j.rb extension - very experimental.

Regarding two phase commit:
Maybe the tx_tracker neo4j.rb extension also can be used for two phase
commit. Instead of writing to disk for 2PC neo4j.rb can write to a
(separate) neo4j graph. So, when neo4j.rb starts it will know
if it has an unfinished transaction by reading the neo4j graph.

/Andreas


On Mon, Jul 13, 2009 at 3:32 AM, David
Beckwith<thirdreplicator at gmail.com> wrote:
> Hello,
>
> I'm trying to understand when the index is in RAM versus when it is
> depending on the disk and how to control that.  I want to do something
> like this:
>
> * keep all of the indexes and data in memory for speed
> * asynchronously (with respect to HTTP requests) write to the
> database, say, every 15 minutes.
> * when the server restarts, read the whole database into memory again
>
> Can somebody outline how one would do this with either Neo4j or
> (preferably) Neo4j.rb ?
>
> Thank you very much,
> David :)
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>


More information about the User mailing list