Gremlin Server中TinkerGraph的磁盘存储位置与方式咨询
Hey there! Let's break this down clearly since you're just getting started with Gremlin and figuring out how your graph data is stored.
Understanding Gremlin Server & TinkerGraph Storage
TinkerGraph: The Default In-Memory Graph
- TinkerGraph is Gremlin's default in-memory graph implementation—it runs entirely in RAM, and by default, it doesn't persist data to disk at all. That means if you shut down or restart your Gremlin Server, all your graph data will be gone.
- If you didn't configure Gremlin Server to connect to a persistent graph database (like Titan/JanusGraph, Neo4j, etc.), then the graph you're interacting with is definitely TinkerGraph.
- Can you make TinkerGraph persist data? Sort of—you can manually export/import it using
GraphMLorGraphSONformats, but this isn't automatic persistence:- Export your graph to a file:
g.io('my-graph-data.graphml').write().iterate() - Import data from a file back into TinkerGraph:
g.io('my-graph-data.graphml').read().iterate()
- Export your graph to a file:
Storage When Using Only Gremlin Server
- Gremlin Server itself is just a middleware service—it doesn't have built-in persistent storage. Its job is to accept Gremlin query requests and forward them to an underlying graph database instance (like TinkerGraph, Titan, etc.).
- You mentioned Titan (now succeeded by JanusGraph) stores data in Cassandra/HBase—that's because Titan is a persistent graph database that relies on external storage engines to save data long-term. Since you're only using Gremlin Server without configuring a persistent backend, you're using the default TinkerGraph (in-memory only).
How to Confirm Which Graph You're Using
To double-check that you're working with TinkerGraph, run this query from your Python client or Gremlin Console:
g.graph.getClass().getName()
If the result is org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph, you're using the in-memory TinkerGraph.
内容的提问来源于stack exchange,提问作者Tushar Aggarwal
相关产品推荐
相关产品推荐

