问题
I have worked with bit older version of Neo4j i.e. 1.8.x. both embedded and REST mode. but I never heard that it store data in-memory. Recently I've been through Neo4j page which says 3 different type of access to neo4j viz:
- neo4j server i.e. REST mode
- embedded mode
- in-memory
How Neo4J works with data in-memory ? and when it was implemented ? was it there from older version i.e. 1.8.x ? or just added in newer version ? any additional changes required in configuration such as Spring data neo4j ?
My findings
I've heard about in-memory database that they handle most of the task in-memory i.e. RAM. for e.g. VoltDB and Redis. (for optimized performance).
回答1:
Neo4j features a stripped down variant called ImpermanentGraphDatabase. This one is intended to be used for testing only. E.g. when you develop a graph enabled application your unit tests might use it. It is not recommended to use ImpermanentGraphDatabase for real life scenarios with large amounts of data.
To use ImpermanentGraphDatabase you typically start with TestGraphDatabaseFactory, this one resides in the neo4j-kernel
jar with classifier tests
, see in the reference manual as well.
Regardless if you're using Neo4j in embedded or server mode, multiple layers of caches get used to make your queries as fast as possible, for details look in the reference manual as well.
To sum up: Neo4j is a transactional, ACID compliant graph database benefitting from your provided amount of RAM by caching. But I won't consider this being a in-memory database.
来源:https://stackoverflow.com/questions/25481353/neo4j-is-it-a-in-memory-graph-database