Running Neo4j purely in memory without any persistence

浪子不回头ぞ 提交于 2019-11-30 11:27:19
DNA

As far as I know, Neo4J data storage and Lucene indexes are always written to files. On Linux, at least, you could set up a ramfs filing system to hold the files in-memory.

See also:

How many changes do you group in each transaction? You should try to group up to thousands of changes in each transaction since committing a transaction forces the logical log to disk.

However, in your case you could instead begin your transactions with:

db.tx().unforced().begin();

Instead of:

db.beginTx();

Which makes that transaction not wait for the logical log to force to disk and makes small transactions much faster, but a power outage could have you lose the last couple of seconds of data potentially.

The tx() method sits on GraphDatabaseAPI, which for example EmbeddedGraphDatabase implements.

you can try a virtual drive. It would make neo4j persist to the drive, but it would all happen in memory https://thelinuxexperiment.com/create-a-virtual-hard-drive-volume-within-a-file-in-linux/

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!