Schema
Neo4j is a natively schema-free database. This allows for the rapid development of graphs that can continue to evolve and expand by incorporating new sources of data.
You can, however, impose an open schema in Neo4j. An open schema applies constraints only to the data explicitly included in the schema. This approach maintains a flexible framework that makes it easy to adapt and grow your data model as new requirements emerge, while also allowing for enforcing the shape of the most stable and established part of the data model.
There are two methods of imposing an open schema in Neo4j:
-
Graph types: enforces holistically an open schema, providing a defined structure for an entire graph. Cypher® 25 only Introduced in 2026.02 Enterprise Edition
-
Constraints: enforces specific constraints on node or relationship properties.
|
All constraints created using the older It is, therefore, recommended to define a schema using a graph type, which offers both additional, more sophisticated constraint types and a more holistic and simplified approach for constraining and maintaining the shape of the data in a graph. |