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