Store formats
Neo4j’s storage engine supports several store formats that describe how data is written to disk.
block format is the recommended format for Enterprise Edition due to its superior performance and scalability.
block format uses advanced data structures and inlining techniques to enhance data locality, which leads to better resource utilization.
aligned is the default format for Community Edition.
standard and high_limit formats are deprecated in Neo4j 5.23.
It is not recommended to use these formats for new databases.
For more information on the deprecation and timeline for the eventual removal of these formats, see Format deprecations.
|
For information on store formats in Neo4j 4.4, see Neo4j Admin and Neo4j CLI → Neo4j Admin → Display store information. |
Available store formats
Here’s an overview of the available formats and their features:
- Block
-
Enterprise Edition+
-
Default format unless
db.formatis specified. -
Performance: Fast queries; uses advanced data structures and inlining techniques for better data locality.
-
Memory efficiency: Optimized collocation of data, which allows more related data to be fetched by fewer read operations; enhancing resource utilization. Block format means a few pages need to be loaded to serve a query, i.e. fewer page faults and less IO.
-
Property access: Properties are stored in blocks with their nodes and relationships drastically reducing the amount of pointer chasing required to access properties.
-
Entity limits: Able to run graphs at large scales. Supports the highest limits at the time of writing. See Block format entity limits for details.
Supports token names (including label, property key, and relationship type names) of any length up to the GQL identifier max length of 16,383 characters. -
Future-proofing: Designed to be extended and improved without requiring store migrations. New features such as data types, or performance enhancements are available without rewriting the store.
-
Supported migration paths to other store formats: Although it is not recommended, you can change your store format from
blocktoalignedorhigh_limit. Note thathigh_limitis deprecated. Thealignedformat has lower limits thanblock, so your graph must fit within those reduced limits.
-
- Aligned
-
-
Default format in Community Edition and for all new databases in Enterprise Edition prior to Neo4j 5.22.
-
Performance: Performs better than
standardbut requires slightly more disk space. -
Memory efficiency: Based on
standardbut with improved memory efficiency. -
Property access: Stores graph data in linked list-like structures on disk.
-
Entity limits: Supports graphs within some limits. See Aligned format entity limits for details.
-
Supported migration paths to other store formats: You can change your store format from
alignedtoblockorhigh_limit. Note that thehigh_limitformat is deprecated, therefore, it is not recommended to migrate to it.
-
- High_limit
-
Enterprise Edition Deprecated in 5.23
-
Performance: Performs slightly worse than
standardand requires more disk space, but allows more nodes and relationships. -
Memory efficiency: Based on
standardbut with improved memory efficiency. -
Property access: Stores graph data in linked list-like structures on disk.
-
Entity limits: From the record formats, supports the highest limits at the time of writing. For more information, see High_limit format entity limits.
-
For information on deprecation and eventual removal, see Format deprecations.
-
Supported migration paths to other store formats: You can migrate to the
blockformat only.
-
- Standard
-
Deprecated in 5.23
-
Performance: Basic, foundational format.
-
Property access: Stores graph data in linked list-like structures on disk.
-
Entity limits: Supports graphs within some limits. See Standard format entity limits for details.
-
For information on deprecation and eventual removal, see Format deprecations.
-
Supported migration paths to other store formats: You can change your store format from
standardtoaligned,block, orhigh_limit. However, it is not recommended to migrate to thehigh_limitformat as it is deprecated.
-
Format deprecations
standard and high_limit formats are deprecated starting from Neo4j 5.23.
block format provides better performance and scalability than the deprecated formats.
They will remain part of the product throughout the v5 and vNext server lifecycles.
The last version of Neo4j to include these formats will be vNext.LTS which is planned for release in November 2026.
LTS versions of Neo4j are supported for 3 years following their release.
This means that support for standard and high_limit formats is planned to end in November 2029.
It is recommended that Enterprise Edition users migrate all databases to block format at their earliest convenience to ensure the best possible performance.
For more information, see Changing the store format of existing databases.
- FAQ
-
-
How can I find out the format of my database?
You can use theSHOW DATABASES YIELD name, storeCypher command to get information about the store format of a database. See Show detailed information for a particular database for a detailed example. -
When will support for
standardandhigh_limitformats end?
The last version of Neo4j to include these formats will be an LTS release planned for November 2026, which will be supported for three years until November 2029. -
How can I change the store format of my database?
For information on changing the store format of an existing database, see Changing the store format of existing databases. -
From which store formats can I migrate, and to which formats?
For information about supported migration paths, refer to Neo4j Admin → Migrate a database.
-
How to set the database store format
You can either set the store format when creating a new database or change the store format of an existing database.
Creating new databases
block is the default format for all newly created databases as long as they do not have the db.format setting specified.
If you want to change it, you can set a new value for the db.format configuration in the neo4j.conf file.
You can also create a new database on a specific store format by passing the new format as an argument to the command creating the database, for example, neo4j-admin database import full or neo4j-admin database copy commands, or by using storeFormat: option in the Cypher command CREATE DATABASE.
The following examples show how to create a new database on the block store format.
However, the same applies to other formats.
neo4j-admin database import full commandbin/neo4j-admin database import full ... --format=block blockdb
neo4j-admin database copy commandbin/neo4j-admin database copy --to-format="block" mydb blockdb
CREATE DATABASE Cypher statementCREATE DATABASE blockdb OPTIONS {storeFormat: 'block'}
Changing the store format of existing databases
The block format is the default format for Enterprise Edition due to its superior performance and scalability.
Therefore, migrating all databases to block format is recommended to ensure optimal performance.
The block format supports token names (including node labels, property keys, and relationship type names) of any length up to the GQL identifier max length of 16,383 characters.
Thus, token names must adhere to this length limit when migrating from aligned to block format.
standard and high_limit formats are deprecated in 5.23 and will be removed in a future release.
For more information, see Format deprecations.
|
Be aware that changing the store format changes the internal IDs assigned to nodes and relationships. This is because the ID represents the element’s physical location in the store file. |
Changing the store format is an IO-intensive offline operation, which re-writes all data in the new format. Therefore, it requires that:
-
There is enough disk space for both old and new copies of the database. During the migration to
blockformat, the database is inherently compacted. Therefore, the disk space required for the migration is approximately the same as the size of the database. You can use the database store size metrics to determine your available disk space and potentially reusable space. -
The graph fits within the new format’s entity limits.
|
For large databases changing the store format can be a time-consuming operation and will also require any indexes to be re-populated. The time required depends on the size of the database, number of indices, speed of the storage devices, and the amount of available memory. For example, a 100GB database might take 10 minutes in optimal conditions, or over an hour in the worst case. Therefore, it is recommended to perform a dry run on a backup to estimate the required time for the migration. |
In a standalone server
Changing the store format of an existing database in a standalone server requires the database to be offline.
The following steps assume that you want to migrate the database called mydb to block format but the same steps apply to other formats.
-
Stop the database using the Cypher command
STOP DATABASE mydb. -
Change the store format of the stopped database using one of the following options:
-
Migrate an existing database using
neo4j-admin database migratecommand.You do not need to run
neo4j-admin database copywith the--compact-node-storeoption prior to runningneo4j-admin database migrate. The database is inherently compacted during the migration process.For example:
bin/neo4j-admin database migrate --to-format="block" mydb -
Pass the new store format as an argument when using the
neo4j-admin database copycommand to create a copy of an existing database. You can also set the--copy-schemaoption to automatically copy the schema definitions. For example:bin/neo4j-admin database copy --to-format="block" mydb blockdb --copy-schema
-
-
After the successful completion, start the database using the Cypher command
START DATABASE mydb. Indexes are populated the first time the database is started, which might take some time if there are property uniqueness constraints.
In a cluster
Changing the store format of an existing database in a cluster requires that you restore a backup of the database that you want to migrate on one of the servers, and then, use that server as a designated seeder for the other cluster members to copy that database from.
The following steps assume that you want to migrate the database called mydb to block format but the same steps apply to other formats.
The database is hosted on three servers in primary mode.
On one of the servers, server01
-
In Cypher Shell, put the database that you want to migrate in read-only mode using the Cypher command
ALTER DATABASE databasename SET ACCESS READ ONLY. For example:@system> ALTER DATABASE mydb SET ACCESS READ ONLY; -
In your command-line tool, back up that database using the
neo4j-admin database backupcommand with the--include-metadata=alloption to include all users and roles associated with it. For example:bin/neo4j-admin database backup mydb --to-path=/path/to/your-backup-folder --include-metadata=allThe command creates a backup archive that contains both the database and the metadata associated with it.
-
In Cypher Shell, drop the database to delete it and all users and roles associated with it:
@system> DROP DATABASE mydb; -
In the command-line tool, restore the backup that you created using the
neo4j-admin database restorecommand:bin/neo4j-admin database restore --from-path=/path/to/your-backup-folder/mydb-2024-03-05T11-26-38.backup mydb -
Migrate the restored database to
blockformat:You do not need to run
neo4j-admin database copywith the--compact-node-storeoption prior to runningneo4j-admin database migrate. The database is inherently compacted during the migration process.bin/neo4j-admin database migrate --to-format="block" mydb -
In Cypher Shell, run
SHOW SERVERSto find the server ID ofserver01. Cross-reference the address to find the server ID. Use any database to connect.SHOW SERVERS YIELD serverId, name, address, state, health, hosting
On one of the servers:
-
Use the
systemdatabase and create the migrated databasemydbusing the server ID ofserver01. The topology ofmydbis stored in thesystemdatabase and when you create it, it is allocated according to the default topology (which can be shown withCALL dbms.showTopologyGraphConfig). For more information, see Designated seeder.CREATE DATABASE mydb OPTIONS {existingData: 'use', existingDataSeedInstance: '<server01 id>'} -
Verify that the database is created and available using the Cypher command
SHOW DATABASE mydb. -
After the successful completion, restore the roles and permissions. For more information, see Restore users and roles metadata.
Verify the store format
You can verify the store format of a database using the following Cypher:
SHOW DATABASES YIELD name, store
+----------------------------------+ | name | store | +----------------------------------+ | "blockdb" | "block-block-1.1" | | "neo4j" | "record-aligned-1.1" | | "system" | "record-aligned-1.1" | +----------------------------------+
Additionally, you can use the neo4j-admin database info command to get detailed information about the store format of a database.
For details, see Display store information.
Store formats and entity limits
The following tables show the format and Neo4j version compatibility and the limits of the different store formats:
Block format
| Name | Store format version | Introduced in | GA from | Default in |
|---|---|---|---|---|
|
|
|
|
|
| Name | Limit |
|---|---|
Nodes |
|
Relationships |
|
Properties |
|
Labels |
|
Relationship types |
|
Property keys |
|
Aligned format
| Name | Store format version | Introduced in | Default in | Unsupported from |
|---|---|---|---|---|
|
|
|
CE, EE < Neo4j 5.22 |
|
|
|
|
|
|
|
|
|
|
| Name | Limit |
|---|---|
Property keys |
|
Nodes |
|
Relationships |
|
Properties |
|
Labels |
|
Relationship types |
|
Relationship groups |
|
Standard formatDeprecated in 5.23
For information on deprecation and eventual removal, see Format deprecations.
| Name | Store format version | Introduced in | Unsupported from |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Limit |
|---|---|
Property keys |
|
Nodes |
|
Relationships |
|
Properties |
|
Labels |
|
Relationship types |
|
Relationship groups |
|
High_limit formatDeprecated in 5.23
For information on deprecation and eventual removal, see Format deprecations.
| Name | Store format version | Introduced in | Unsupported from |
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Limit |
|---|---|
Property keys |
|
Nodes |
|
Relationships |
|
Properties |
|
Labels |
|
Relationship types |
|
Relationship groups |
|