Running Neo4j purely in memory without any persistence

前端 未结 3 975
春和景丽
春和景丽 2021-01-01 19:23

I don\'t want to persist any data but still want to use Neo4j for it\'s graph traversal and algorithm capabilities. In an embedded database, I\'ve configured cache_typ

3条回答
  •  感动是毒
    2021-01-01 20:07

    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.

提交回复
热议问题