A production-style recommendation service using Neo4j, Java, and microservices architecture that supports the following:
- Collaborative filtering
- Item-based recommendations
- Hybrid recommendation models
This system demonstrates how graph databases can power real-time, relationship-driven recommendations, similar to platforms like Netflix, Amazon, or Spotify.

Problem Statement
Modern applications need to answer questions like:
- What should this user watch next?
- Which products are similar?
- What content is relevant based on user behavior?
Traditional databases struggle with these because of complex joins and relationship traversal.
This is where Neo4j (Graph Database) becomes powerful.
Why Neo4j for Recommendation Systems?
Recommendation systems are fundamentally about relationships:
- Users → Movies
- Users → Products
- Items → Similar Items
Neo4j allows:
- Fast traversal of relationships
- Real-time recommendations
- Flexible graph modeling
- Efficient similarity queries
Instead of complex SQL joins, recommendations become simple graph traversals.
System Architecture
Client Request
↓
Spring Boot API
↓
Recommendation Service
↓
Neo4j Graph Database
↓
Recommended Results
- REST APIs built using Spring Boot
- Graph queries executed using Cypher
- Results returned in real-time
Recommendation Techniques Implemented
1️⃣ Collaborative Filtering
Recommends items based on similar users.
Example:
Users who liked Inception also liked Interstellar
Graph idea:
(User)-[:LIKED]->(Movie)<-[:LIKED]-(OtherUser)
2️⃣ Item-Based Filtering
Recommends items based on similar items.
Example:
If you liked The Matrix, you may like John Wick
Graph idea:
(Movie)-[:SIMILAR_TO]->(Movie)
3️⃣ Hybrid Recommendation System
Combines:
- User similarity
- Item similarity
- Behavioral patterns
This improves accuracy and diversity of recommendations.
API Endpoints
The service exposes REST APIs for different recommendation strategies.
GET /v1/recommendations/collaborative/{userId}
GET /v1/recommendations/movie/{movieId}
GET /v1/recommendations/hybrid/{userId}
Performance & Optimization
While building this system, focus were on:
- Efficient graph traversal queries
- Limiting traversal depth
- Indexing frequently accessed nodes
- Reducing query complexity
- Designing optimized relationships
Graph databases shine when queries are designed correctly.
Real-World Use Cases
This system can be adapted for:
- Movie / content recommendations
- E-commerce product suggestions
- Social network connections
- Learning platforms (course recommendations)
- Knowledge graph-based suggestions
Github repo : recommendation-service
Get your Neo4j Certified Professional Certificate from GraphAcademy.
About Me
Abhishek KumarBackend Software Engineer | Java • Spring Boot • Neo4j • Microservices
Backend engineer with 4+ years of experience building scalable backend systems using Java, Spring Boot, Neo4j, Kafka, and Elasticsearch. Passionate about microservices architecture and graph databases.
Open to opportunities in backend engineering and graph database development.