问题
Hi I am using neo4j in my application and my structure is as following:
- I am using Embedded Graph API
- I have several databases that I point to using a pool that I maintain in my application eg-> db1, db2, db3, ..... db100
- When I want to access a particular database I point to it using new EmbeddedGraphDatabase("Path to db(n)")
- The problem is that when the connection pool count increases the RAM size being consumed by the application keep increasing and breaks down the application at a point of limit.
- So I am Thinking of migrating from Neo4j to some other Database.
- Additionally only a small part of my database is utilizing the graph structure.
One way for migration is that I write a script for it. Is there any better option?
My another question is what is the best Database so that my structure can be maintained.
Other view-point that I am thinking about is I can keep part of my data into Neo4j and shift another part to some other database.
If anything is unclear I can clarify.
Thanks in advance.
回答1:
An EmbeddedGraphDatabase instance is not the equivalent of a "connection" in SQL. It's designed to run a long time (days, months). Hence starting/stopping is costly.
What is the use case for having hundreds of separate databases in the same JVM?
回答2:
Your lots of small databases will perform poorly as the graphdb is designed to hold the whole datamodel on a single host.
Do you run a single JVM per database?
You can control the amount of memory used by neo4j by providing the correct properties for memory mapping and also use the gcr cache from neo4j-enterprise and control the cache size-property variables.
I think it still makes sense to keep the graph part in Neo4j and only move the non-graphy part.
来源:https://stackoverflow.com/questions/12673331/migrate-data-from-neo4j-to-sql