You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/database-internals/store-formats.adoc
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -554,12 +554,14 @@ The following data is stored for each element:
554
554
* Relationships: a unique ID, one type, a source node, a target node, and a collection of properties.
555
555
* Properties: key-value pairs.
556
556
557
+
All graph data files are stored under _$NEO4J_HOME/data/databases/databasename_.
558
+
557
559
[[block-format-store-files]]
558
560
== Block format store files
559
561
560
-
The block formatgraph data files are stored under _$NEO4J_HOME/data/databases/databasename_.
561
-
They are organized into a three-store logical structure that adapts to the amount of data stored for each node and relationship.
562
-
The following is an overview of the most important store files, the store they belong to, data they contain, the size of each record, and what they are used for.
562
+
In `block` format, all graph elements are stored in a set of store files with the prefix _block._.
563
+
They are organized into three types of stores that adapt to the amount of data stored for each node and relationship.
564
+
The following is an overview of the most important store files, the store type they belong to, data they contain, the size of each record, and what they are used for.
563
565
564
566
=== Small store
565
567
@@ -572,7 +574,7 @@ The encoding attempts to fit as much data into this block as possible, typically
572
574
The amount of data that fits depends heavily on the type and size of the data.
573
575
If you have more labels, but no properties or small properties, more labels will fit, and vice versa.
574
576
The same applies to relationships.
575
-
You can fit more relationships if there are fewer properties, and vice versa.
577
+
You can fit more relationships if there are fewer relationship properties, and vice versa.
576
578
Keep in mind that if no data is present, the block still occupies 128 B.
577
579
This block persists as long as the node exists.
578
580
@@ -596,19 +598,19 @@ The size of this record also adapts to the total size of the relationship data,
596
598
The record in _block.x1.db_ stores a reference to this dynamic record.
597
599
This record can typically contain hundreds of relationships.
598
600
599
-
=== Dense stores
600
-
601
-
When the data connected to nodes, relationships, or properties exceeds the capacity of both the small and dynamic stores, the data is stored in the dense store files.
602
-
It is based on a multi-root generational B+ tree structure that allows for efficient storage and retrieval of large amounts of data, where each node has a separate root.
603
-
The following dense store files exist:
604
-
605
601
_block.big_values.db_::
606
602
All properties of total _size < ~31 B_ are inlined with the node and relationship data in the small or dynamic stores. +
607
603
Properties exceeding 31 B when encoded, typically longer strings or arrays, are stored in this file, and a reference is placed in the value's stead.
608
604
The size of these records adapts to the encoded size of the property value, where the _size = X * 64 B_, with a maximum record size of 8192 B.
609
605
If the encoded size of a property exceeds the maximum record size, the data is split into multiple records and linked together as a linked list.
610
606
See xref:performance/space-reuse.adoc#space-reuse-large-property-values[Reuse of space for large property values in block format] for more details.
611
607
608
+
=== Dense stores
609
+
610
+
When the data connected to nodes and relationships exceeds the capacity of both the small and dynamic stores, the data is stored in the dense store files.
611
+
It is based on a multi-root generational B+ tree structure that allows for efficient storage and retrieval of large amounts of data, where each node has a separate root.
612
+
The following dense store files exist:
613
+
612
614
_block.relationship.dense.db_::
613
615
Relationship dense store holds relationships for nodes with a large number of relationships.
614
616
When the relationship data of a node exceeds the maximum size of the dynamic relationship record, the overflowing relationships are moved to this store.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/performance/space-reuse.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,11 @@ If you want to shrink the size of your database, do not delete the _.id_ files.
44
44
The store files must _only_ be modified by the Neo4j database and the `neo4j-admin` tools.
45
45
====
46
46
47
-
[role=label--new-2025.12]
47
+
[role=label--new-2026.01]
48
48
[[space-reuse-large-property-values]]
49
49
== Reuse of space for large property values in block format
50
50
51
-
Starting with Neo4j 2025.12, when allocating a large value of N units, if no such ID is available, the record is split into multiple smaller records.
51
+
Starting with Neo4j 2026.01, when allocating a large value of N units, if no such ID is available, the record is split into multiple smaller records.
52
52
This guarantees the reuse of space for large property values stored in the _block.big_values.db_ store file, sacrificing colocation in some cases.
53
53
The level of accepted fragmentation is dynamic and depends on the fraction of unused records, i.e., no fragmentation if < 5% of the space is unused, then accepting some fragmentation for a bit higher unused percentage.
54
54
If the unused percentage is high, records can be even more fragmented.
0 commit comments