Database Management System (DBMS) / No SQL Databases

Graph based stores

A Graph Database is a type of NoSQL database designed to store and query highly interconnected data using nodes (entities) and edges (relationships).

Instead of using tables or documents, graph databases model data as a graph — ideal for scenarios where relationships are as important as the data itself.


🧱 Basic Components

Term

Description

Example

Node

Represents an entity

User, Product, City

Edge

Represents a relationship between nodes

FOLLOWS, LIKES, LIVES_IN

Property

Key-value data stored on nodes/edges

"name": "Alice", "age": 21


🧠 Why Use Graph Databases?

They allow fast traversal of deeply nested relationships without complex joins. Ideal for:

  • Exploring relationships

  • Multi-hop queries

  • Pattern matching


🔍 Use Cases

Use Case

Description

🧑‍🤝‍🧑 Social Networks

Users connected by friendships, likes, followers

🛍️ Recommendation Engines

"People who liked X also liked Y"

🧠 Knowledge Graphs

Semantic relationships between concepts

🚨 Fraud Detection

Identify patterns of suspicious transactions

📍 Geospatial / Route Optimization

Find shortest paths between places


🧰 Popular Graph Databases

Database

Features

Neo4j

Most widely used; Cypher query language

ArangoDB

Multi-model DB (graph + document)

OrientDB

Supports documents and graphs

Amazon Neptune

Fully managed graph DB on AWS

JanusGraph

Open-source, scalable over big data backends (Cassandra, HBase)


🧾 Query Example (Neo4j – Cypher Syntax)

MATCH (u:User)-[:FRIENDS_WITH]->(f:User)
WHERE u.name = "Alice"
RETURN f.name

➡️ This returns the names of all users who are friends with Alice.


✅ Advantages

Advantage

Description

🔍 Fast relationship queries

Traverses deep connections efficiently

🔁 No need for joins

All relationships are first-class citizens

🧱 Flexible schema

Nodes can have any shape or properties

📊 Perfect for networked data

Easy to model complex webs of connections


❌ Limitations

Limitation

Description

❌ Not ideal for flat data

Overkill for simple key-value or tabular use cases

❌ Scalability complexity

May require tuning and advanced setup for large graphs

❌ Fewer options

Fewer tools and community support compared to SQL/Document DBs


🧮 Graph vs Other NoSQL Types

Feature

Graph DBs

Other NoSQL Types

Primary Data Model

Nodes & Edges

Key-Value, JSON, Columns

Best for

Relationships & traversals

Documents, analytics, caching

Query Type

Pattern matching, traversal

Key/ID-based retrieval

Join Support

Built-in & optimized

Usually not supported