Online Backup for neo4j Community Edition

1,961 views
Skip to first unread message

Jesse

unread,
Apr 2, 2012, 1:57:07 PM4/2/12
to Neo4j
Hi,

I'm working on a proof of concept/pilot application based on neo4j and
have some questions about hot backups. I understand that there are
nice hot backup facilities built into the enterprise version but since
we're just getting started we're not yet ready to invest in an
enterprise license -- however one of the requirements we have for our
pilot is to be able to execute hot backups...

So now I'm stuck trying to figure out how to implement hot backups on
my own until we can prove that we should buy an enterprise
license. :-)

We dont anticipate our graph growing to be all that large, so I'm
wondering if I can just get hold of the write ahead log, synchronize
on it, rotate the log, and then backup the neo4j files. Here is a
snippet of code which seems to work -- I was wondering if someone
could validate that it does what I think it does:

//We're running in a Spring managed environment so the
graphDatabaseService referenced below is
//a singleton EmbeddedGraphDatabase instance which spring manages and
injects during startup.
TxModule txModule = ((EmbeddedGraphDatabase)
graphDatabaseService).getConfig().getTxModule();
XaDataSourceManager xaDataSourceManager =
txModule.getXaDataSourceManager();
XaDataSource xaDataSource =
xaDataSourceManager.getXaDataSource("nioneodb");
XaLogicalLog logicalLog =
xaDataSource.getXaContainer().getLogicalLog();
synchronized (logicalLog) {
logicalLog.rotate();
FileUtils.copyDirectory(new File("/app/graph"), new File("/
app/graph-" + new Date().getTime()));
}

I'm thinking this should block any write transactions for the duration
of the log rotation/file copy but still allow read operations to
continue. Once the rotation/file copy is done any queued write
transactions will proceed as usual. I understand that any write
transactions that are attempted while this is in progress will block,
but since our graph is small this should only be a few seconds. I
also realize that this is relying on some internal implementation
details of neo4j but it's the best solution I've come up with so far.

Does this seem like it should work? Does anyone have any better
suggestions?

Thanks!

Stéphane

unread,
Apr 2, 2012, 3:47:06 PM4/2/12
to ne...@googlegroups.com
Isn't enterprise version free ?
http://neo4j.org/download/

Regards,

Peter Neubauer

unread,
Apr 2, 2012, 3:49:38 PM4/2/12
to ne...@googlegroups.com
Yup,
it is. Also, we are working on a Bootstrap program that will let you
not worry about this if you are bootstrapping your startup. More on
that later, contact me for details.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j                                - Graphs rule.
Program or be programmed - Computer Literacy for kids.
http://foocafe.org/#CoderDojo

Jesse

unread,
Apr 2, 2012, 4:04:09 PM4/2/12
to Neo4j
Ok -- I think I misunderstood the licensing model. It sounded to me
that if I was working on closed source and wanted to use enterprise I
had to buy a license, but I guess that must only be if I need support.

Sorry for the extra traffic on the mailing list.

Thanks for the responses though!

On Apr 2, 3:49 pm, Peter Neubauer <peter.neuba...@neotechnology.com>
wrote:
> Yup,
> it is. Also, we are working on a Bootstrap program that will let you
> not worry about this if you are bootstrapping your startup. More on
> that later, contact me for details.
>
> Cheers,
>
> /peter neubauer
>
> G:  neubauer.peter
> S:  peter.neubauer
> P:  +46 704 106975
> L:   http://www.linkedin.com/in/neubauer
> T:   @peterneubauer
>
> Neo4j                                - Graphs rule.
> Program or be programmed - Computer Literacy for kids.http://foocafe.org/#CoderDojo
>
>
>
>
>
>
>
> On Mon, Apr 2, 2012 at 9:47 PM, Stéphane <stephane.er...@gmail.com> wrote:
> > Isn't enterprise version free ?
> >http://neo4j.org/download/
>
> > Regards,
>

Peter Neubauer

unread,
Apr 2, 2012, 4:48:05 PM4/2/12
to ne...@googlegroups.com
Jesse,
regarding the Enterprise version you are right. However, I suggest you
contact me off list, if you need to get going on closed source terms
in a bootstrap scenario - we know what it's like, therefore the
bootstrap model.

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Neo4j                                - Graphs rule.
Program or be programmed - Computer Literacy for kids.
http://foocafe.org/#CoderDojo

Stefan Armbruster

unread,
Apr 2, 2012, 5:27:06 PM4/2/12
to ne...@googlegroups.com
Another possible option: If you're on Linux you could probably use LVM
snapshots for this: http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html

Regards,
Stefan

david hay

unread,
Aug 12, 2013, 5:57:23 AM8/12/13
to ne...@googlegroups.com
Hi,

Can I confirm that it is possible to use the enterprise edition (and more particularly the on-line backup facility) without paying the annual fee as suggested in this trail? I'm trying to interest my company in this technology - they have suggested building a small app for in-house use to test the technology but are unwilling to proceed if there is no way of performing on-line backups (which are pretty standard with sql technology) without paying the annual license fee - at least until the technology is proven for our purpose.

cheers...

Peter Neubauer

unread,
Aug 12, 2013, 7:03:53 AM8/12/13
to Neo4j User

David,
As suggested - reach out to sa...@neotechnology.com to discuss this - should not be an obstacle.

/peter

(snt)-[frm]->(phn)

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

David.hay25

unread,
Aug 12, 2013, 2:16:53 PM8/12/13
to ne...@googlegroups.com, Neo4j User
Thanks Peter - I'll do that. 

(dh)-[thks]->(phn)

Cheers...
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/u7zrOmh3QZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages