0

On the SQL Server side there is the query: CREATE DATABASE name

What about the gremlin?

I have started gremlin and every time I open my laptop, run data, it loses all data. I have to recreate the data. How do I create a database and every time I run it, my data remains. Sorry for my English not good

1 Answers1

1

In your comments you mentioned you were using "tinkerpop" as your graph database. TinkerPop by itself isn't a graph database. I'll assume you meant TinkerPop's graph database implementation TinkerGraph. It makes sense that your data is lost if using TinkerGraph because it is a in-memory graph database. You can persist that data if you like but you have to tell TinkerGraph to do so.

You will need to add gremlin.tinkergraph.graphLocation and gremlin.tinkergraph.graphFormat configurations to TinkerGraph. I assume you are using Gremlin Server since you use .NET so you likely just need to add those settings to the conf/tinkergraph-empty.properties file (assuming you've left the default file naming and out-of-box configuration).

That said, TinkerGraph is really meant to be an in-memory graph. Persisting data to disk is a bit of a convenience for users and not meant for high transaction use cases. You should consider other TinkerPop-enabled graph databases to configure in Gremlin Server for those situations (like JanusGraph) or perhaps use a service like Amazon Neptune. The fully listing of available graphs you can use with TinkerPop can be found on the TinkerPop project home page.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Can you give me a guide link to configure it? And how do I call my database name? – Sâu Lười Jan 30 '21 at 09:55
  • i already did. see the link to TinkerGraph i provided and scroll down to the "Configuration" section for more details. – stephen mallette Jan 30 '21 at 11:52
  • 1. How to configure gremlin.tinkergraph.graphLocation. I have looked at https://tinkerpop.apache.org/docs/current/reference/#_configuration. 2. And also trying to save the data, I tried g.io ('data/tinkerpop-crew.kryo').write ().iterate (). But it failed – Sâu Lười Feb 04 '21 at 09:53
  • It's right in my answer: "I assume you are using Gremlin Server since you use .NET so you likely just need to add those settings to the conf/tinkergraph-empty.properties file (assuming you've left the default file naming and out-of-box configuration)." that `tinkergraph-empty.properties` file or whatever you have now called it is used by Gremlin Server to configure TinkerGraph (again, unless you have modified the default setup). – stephen mallette Feb 04 '21 at 13:40
  • I used this command: g = traversal (). WithRemote ('conf / remote-graph.properties') on the gremlin console and I was able to connect to .net when I post data on .net and output the data. from the successful gremlin console. – Sâu Lười Feb 05 '21 at 01:32
  • Doesn't seem like you understand what I mean? What I need is to save, when I turn off the laptop, and reopen the laptop, and run my code, the data is not lost as it is stored in memory. I need clear code or tutorial to do that. Next I need to verify my account on .net. Once I created an account on the console, but I still got access to any account on the .net so it was not secure. This is the code I created an account on the gremlin console: credentials.user ("marko", "rainbow-dash") – Sâu Lười Feb 05 '21 at 01:32
  • Did you add the configuration I suggested? Without that configuration on the server the data will not be persisted. What you do in .NET has nothing to do with saving data. Data is saved on the server. You must therefore configure the server, or more specifically the graph hosted in the server, to save the data. When you send Gremlin from .NET to the server, the graph on the server will then know to save your data – stephen mallette Feb 05 '21 at 11:20
  • By the way, if you are explicitly "turning off laptop" (which you keep mentioning) then you have a different problem with saving. TinkerGraph is an in-memory graph and will only persist data it has in memory on a shutdown of Gremlin Server. So, if you turn off your laptop with no shutdown, that could be the reason why your data is disappearing. If you need different behavior, I suggest you switch to a different TinkerPop-enabled graph like JanusGraph which will flush writes to disk on each request to the server. Choose the right graph for your use case. – stephen mallette Feb 05 '21 at 11:23