0% found this document useful (0 votes)
2 views5 pages

Understanding Nodes in Graph Databases

A Node is the fundamental unit of data in a graph database, representing entities such as people, products, or events. Nodes have labels for categorization, properties for storing details, and connect to other nodes through relationships, forming a graph. Unlike traditional SQL databases, nodes eliminate the need for joins, as relationships are direct and efficient.

Uploaded by

gstformyclients
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Understanding Nodes in Graph Databases

A Node is the fundamental unit of data in a graph database, representing entities such as people, products, or events. Nodes have labels for categorization, properties for storing details, and connect to other nodes through relationships, forming a graph. Unlike traditional SQL databases, nodes eliminate the need for joins, as relationships are direct and efficient.

Uploaded by

gstformyclients
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

What Are Nodes?

A Node is the basic unit of data in a graph database.

Think of a node as:

• A person

• A product

• A city

• An event

• A bank account

Nodes represent entities or objects.

Key Characteristics of Nodes

✔ 1. Nodes have labels

Labels act like categories or types.

Examples:

• :Person

• :Movie

• :Product

Example node:

(:Person)

✔ 2. Nodes have properties

Properties store details inside the node.


Example:

(:Person {name: "John", age: 30})

Properties = key–value pairs


(name = John, age = 30)

✔ 3. Nodes connect to other nodes using relationships

Nodes don't live alone. They form a graph through relationships.

(Person) --FRIEND_OF--> (Person)

Real Examples of Nodes

Person Node

CREATE (:Person {name:'John', age: 30, city:'Delhi'});

Movie Node

CREATE (:Movie {title:'Inception', year:2010});

Product Node

CREATE (:Product {id:101, name:'iPhone', price:699});

Nodes in Real Graphs


Nodes represent items, and relationships connect them:

Example:

(Person) --ACTED_IN--> (Movie)

(Product) --BELONGS_TO--> (Category)

(User) --PURCHASED--> (Product)

How Nodes Differ From Tables (SQL)

SQL (Relational DB) Neo4j Graph DB

Rows in tables Nodes in a graph

Foreign keys Relationships

Joins required No joins required

Relationships are logical Relationships are physical & fast

Quick Visual Model

Node = Circle
Relationship = Arrow
Properties = Data inside circle
Labels = Categories around circle

You might also like