What is a graph database?

A Neo4j graph database stores nodes and relationships instead of tables or documents. Data is stored just like you might sketch ideas on a whiteboard. Your data is stored without restricting it to a pre-defined model, allowing a very flexible way of thinking about and using it.

To learn more about graph fundamentals, see Graph database concepts.

The property graph model

In Neo4j, information is organized as nodes, relationships, and properties.

Nodes are the entities in the graph.

  • Nodes can be tagged with labels, representing their different roles in your domain (for example, Person).

  • Nodes can hold any number of key-value pairs, or properties (for example, name).

  • Node labels may also attach metadata (such as index or constraint information) to certain nodes.

Relationships provide directed, named connections between two node entities (for example, Person LOVES Person).

  • Relationships always have a direction, a type, a start node, and an end node, and they can have properties, just like nodes.

  • Nodes can have any number or type of relationships without sacrificing performance.

  • Although relationships are always directed, they can be navigated efficiently in any direction.

If you’d like to learn more about any of these, you can read more about Graph Data Modeling.

What is Neo4j?

colored tile graph arr

Neo4j is a native graph database, which means that it implements a true graph model all the way down to the storage level. The data is stored as you whiteboard it, instead of as a "graph abstraction" on top of another technology. Beyond the core graph, Neo4j also provides: ACID transactions, cluster support, and runtime failover.

Neo4j is offered as a managed cloud service via AuraDB. But you can also run Neo4j yourself with either Community Edition or Enterprise Edition. The Enterprise Edition includes all the features of Community Edition, plus extra enterprise requirements such as backups, clustering, and failover abilities. Neo4j is written in Java and Scala, and the source code is available on GitHub.

What makes Neo4j the easiest graph to work with?

  • Cypher®, a declarative query language similar to SQL, but optimized for graphs. Now used by other databases like SAP HANA Graph and Redis graph via the openCypher project.

  • Constant time traversals in big graphs for both depth and breadth due to efficient representation of nodes and relationships. Enables scale-up to billions of nodes on moderate hardware.

  • Flexible property graph schema that can adapt over time, making it possible to materialize and add new relationships later to shortcut and speed up the domain data when the business needs change.

  • Drivers for popular programming languages, including Java, JavaScript, .NET, Python, and many more.

Why graph databases?

We live in a connected world, and understanding most domains requires processing rich sets of connections to understand what’s really happening. Often, we find that the connections between items are as important as the items themselves.

How else do people do this today? While existing relational databases can store these relationships, they navigate them with expensive JOIN operations or cross-lookups, often tied to a rigid schema. It turns out that "relational" databases handle relationships poorly. In a graph database, there are no JOINs or lookups. Relationships are stored natively alongside the data elements (the nodes) in a much more flexible format. Everything about the system is optimized for traversing through data quickly; millions of connections per second, per core.

Graph databases address big challenges many of us tackle daily. Modern data problems often involve many-to-many relationships with heterogeneous data that sets up needs to:

  • Navigate deep hierarchies.

  • Find hidden connections between distant items.

  • Discover inter-relationships between items.

Whether it’s a social network, payment networks, or road network you’ll find that everything is an interconnected graph of relationships. And when you want to ask questions about the real world, many questions are about the relationships rather than about the individual data elements.

Where and how is Neo4j used?

Neo4j is used today by thousands of startups, educational institutions, and large enterprises in all sectors including financial services, government, energy, technology, retail, and manufacturing. From innovative new technology to driving businesses, users are generating insights with graph, generating new revenue, and improving their overall efficiency.

You can find more information about numerous use cases when connected data matters most on our website.