[ 
https://issues.apache.org/jira/browse/TINKERPOP-2225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16847732#comment-16847732
 ] 

stephen mallette commented on TINKERPOP-2225:
---------------------------------------------

Thanks for your suggestion, however I tend to feel like I'd be against such a 
change. I feel like TinkerGraph is, first and foremost, an in-memory graph so 
adding the complexity of a partial persistence system beyond what we allow 
today on {{close()}} seems too far out of the scope of its purpose. I think 
that you could probably rig something in the server (I assume your'e using 
Gremlin Server when you refer to "server" in your post) as part of a background 
thread spawned in the server init script that could do what your'e talking 
about as a cron job. of course....that has it's problems as TinkerGraph really 
isn't guaranteed to be threadsafe on writes so you could run into some weird 
things if you were writing while something else was. I think you would just 
issue a {{g.io("graph.json").write().iterate()}} (which you could send remotely 
too i suppose and avoid the init script and "thread in the server". 

I think that if you need persistence for your preprod testing I would just use 
Neo4j (or perhaps JanusGraph with berkeleydb??) - in other words, a graph 
designed to persist data. That would be a lot better and avoid workarounds. 

I hope these options are helpful.

> May be useful an option to save on disk?
> ----------------------------------------
>
>                 Key: TINKERPOP-2225
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2225
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: tinkergraph
>    Affects Versions: 3.3.6
>            Reporter: Daniele Brugnara
>            Priority: Minor
>
> I am aware about the option _gremlin.tinkergraph.graphLocation_ that saves on 
> disk when the server is terminated.
> Here I'm asking about the possibility to add something that saves on disk 
> "sometimes".
> Something easy like a cron or catching a _SIGUSR1/2_ that simply triggers the 
> _saveGraph()_ method, that is now a private function in the 
> _org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.java_ file.
> I really don't know if the save can be done in a running server, so please 
> forgive me if this is simply impossible.
> But if it could be possible, doesn't make sense to you? 
> We may adopt this server at least for a preprod environment if I can avoid 
> the reboot in order to have persistence ;)
> Many thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to