Cache types

Neo4j maintains two separate caches for nodes and relationships that can be configured to have a variable upper bound in terms of size, which can be configured by the max_node_cache_size and max_relationship_cache_size options of the database. The implementations of caching techniques in Neo4j can be explored in the org.neo4j.kernel.impl.cache package. Neo4j provides four different types of caches built into the default package:

Cache type

Property

NoCache

This is degenerate and stores nothing

LruCache

This utilizes LinkedHashMap of the java.util package along with a custom method to remove the oldest entry when deallocating space—removeEldestEntry(); this makes it an adaptable LRU cache

SoftLruCache

An LruCache using soft values ...

Get Neo4j High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.