1.2. Neo4j databases and graphs

This section describes databases and graphs in Neo4j.

Cypher queries are executed against a Neo4j database, but normally apply to specific graphs. It is important to understand the meaning of these terms and exactly when a graph is not a database.

Most of the time Cypher queries are reading or updating queries which are run against a graph. There are, however, administrative commands that apply to a database, or to the entire DBMS. Such commands cannot be run in a session connected to a normal user database, but instead need to be run within a session connected to the special system database.

More on this requirement is described in the chapter on Administration.

1.2.1. The System Database and the Default Database

All Neo4j servers will contain a built-in database called system which behaves differently than all other databases. In particular, when connected to this database you can only perform a specific set of administrative functions, as described in detail in the section on administration. Most of the available administrative commands can only be run by users with specific administrative privileges. Information on configuring the security privileges is described in the Operations Manual as well as the section below on security commands.

A fresh installation of Neo4j will include two databases:

  • system - the system database described above, containing meta-data on the DBMS and security configuration.
  • neo4j - the default database, named using the config option dbms.default_database=neo4j.

1.2.2. Different editions of Neo4j

Neo4j has two editions, a commercial Enterprise Edition with additional performance and administrative features, and an open-source Community Edition. Cypher works almost identically between the two editions, and as such most of this manual will not differentiate between them. In the few cases where there is a difference in Cypher language support or behaviour between editions, these are highlighted as described below in Section 1.2.3, “Limited Support Features”.

However it is worth listing up-front the key areas that are not supported in the open-source edition:

Feature Enterprise Community

Multi-database

Any number of user databases

Only system and one user database

Role-based security

User, Role and Privilege management for flexible access control and sub-graph access control.

Multi-user management. All users have full access rights.

Constraints

Existence constraints and multi-property NODE KEY constraints.

Only single property uniqueness constraints

1.2.3. Limited Support Features

Some elements of Cypher do not work in all deployments of Neo4j, and we use specific markers to highlight these cases:

Marker Description Example

deprecated

This feature is deprecated and will be removed in a future version

DROP INDEX ON :Label(property)

enterprise-only

This feature only works in the enterprise edition of Neo4j

CREATE DATABASE foo

fabric

This feature only works in a fabric deployment of Neo4j.

USE fabric.graph(0)