1 Why Neo4j?

ShaDey Inc.'s current physical data model is a star schema with 24 entities and 24 relationships, optimised for aggregation queries: "What were total sales by store last quarter?" But several critical business problems are traversal problems, where the answer lies in walking chains of relationships across multiple hops. Star schemas answer the first efficiently; Neo4j's native graph storage and index-free adjacency answer the second in milliseconds. Neo4j stores relationships as direct physical pointers between nodes, meaning traversal cost is proportional to the result set, not the total data volume.

When the question is "how much?" use the star schema. When the question is "how are things connected?" or "what is affected?" use Neo4j. They are complementary, not competing. Neo4j's Cypher query language makes graph traversals as readable as SQL makes aggregations.
Characteristic Star Schema (Current PDM) Neo4j (Proposed)
Optimised For Aggregation, GROUP BY, SUM, AVG Traversal, path finding, impact analysis
Query Pattern "Total revenue by store for Q4" "Which customers are affected if Supplier X fails?"
Join Depth Efficient at 1-3 joins Efficient at 3-15+ hops
Schema Fixed star/snowflake with SCD Type 2 Neo4j Labeled Property Graph with node labels, relationship types, and property constraints
Relationship Cost Expensive (hash joins at query time) Free via index-free adjacency (Neo4j stores relationships as direct physical pointers)
ShaDey Entities All 24 entities (6 dims, 5 facts, 10 DPs, 3 ML) Subset: dims + facts as Neo4j nodes with labels, new relationship types
Technology PostgreSQL / Snowflake / Redshift Neo4j Enterprise (Cypher query language, APOC library, Graph Data Science)
Neo4j is not a replacement for the data warehouse. Periodic aggregation (monthly P&L, inventory snapshots, sales daily rollups) should remain in the star schema. Neo4j handles the real-time, relationship-intensive queries that the warehouse struggles with. Use Neo4j's APOC and GDS libraries for graph algorithms, not for OLAP-style rollups.

2 Supply Chain Risk Propagation

When a supplier has a quality failure, delivery disruption, or capacity constraint, ShaDey Inc. needs to instantly understand the blast radius: which products, stores, open orders, and ultimately which customers are affected. In the relational model this requires joining supplier → product → sales_order → customer across fact tables. In Neo4j, it is a single Cypher traversal that leverages index-free adjacency to walk the chain in constant time per hop.

Business Problem
Supplier disruption impact analysis in seconds, not hours

Scenario: TexFab Industries, a key textile supplier, fails a quality inspection on a batch of fabric. The procurement team needs to know within seconds: (1) which finished products use this fabric, (2) which stores stock those products, (3) which open orders are at risk, and (4) which VIP customers have pending orders.

RDBMS Challenge: In the current star schema, this requires a 5-table join chain: supplier → product → inventory → store plus supplier → product → sales_txn → sales_order → customer. With millions of rows in fact tables, this query takes 30-60 seconds and requires careful index tuning.

Neo4j Solution: A single Cypher traversal walks the relationship chain in under 100ms, regardless of total data volume. Neo4j's native graph storage engine uses index-free adjacency, meaning each node physically points to its neighbours. Traversal cost is O(relationships followed), not O(total rows). Combined with Neo4j's property indexes on name and status fields, the initial node lookup is sub-millisecond.

supplier product store sales_order customer
Supplier TexFab Industries Product Cotton Polo Shirt Store Flagship NYC Sales Order SO-2026-48291 Customer VIP Gold Member Alt. Supplier WeaveMax Ltd PROVIDES STOCKED_AT LINE_ITEM_OF PLACED_BY CAN_REPLACE
Supply Chain Risk Graph: Supplier disruption propagates through product, store, order, and customer nodes
Neo4j Cypher: Supplier Disruption Impact
// Find all affected open orders and VIP customers MATCH (s:Supplier {name: 'TexFab Industries'}) -[:PROVIDES]->(p:Product) -[:LINE_ITEM_OF]->(o:SalesOrder {status: 'open'}) -[:PLACED_BY]->(c:Customer) RETURN p.name AS product, o.order_id AS order, c.name AS customer, c.loyalty_tier AS tier ORDER BY c.loyalty_tier DESC // Find alternate suppliers who can fulfil the same products MATCH (s:Supplier {name: 'TexFab Industries'}) -[:PROVIDES]->(p:Product) <-[:CAN_REPLACE]-(alt:Supplier) WHERE alt.quality_score > 0.85 RETURN p.name, alt.name, alt.lead_time_days, alt.quality_score
Stage 4: Sourcing Stage 5: Manufacturing Stage 6: Quality Stage 8: Distribution
During ShaDey Inc.'s 2024 cotton supplier crisis, it took the procurement team 4 hours to manually trace affected products across SAP tables. A Neo4j instance with the supply chain graph loaded would have provided the complete impact map in under 2 seconds via Cypher, enabling immediate order rerouting and customer communication.

3 Customer 360 & Recommendation Network

ShaDey Inc.'s dp_cust360 data product aggregates metrics per customer. But cross-customer intelligence requires graph traversal: "customers who bought X also bought Y", "which customers have similar purchase patterns to this churning VIP?", and "which promotions resonate with this customer's peer group?"

Business Problem
Real-time recommendations and churn prediction through customer similarity

Scenario: A VIP Gold customer with $12,000 annual spend shows declining purchase frequency. The retention team needs to know: (1) which similar customers already churned, (2) what those customers bought before churning, (3) which promotions successfully re-engaged similar customers, and (4) real-time product recommendations based on peer purchases.

RDBMS Challenge: Computing customer similarity requires self-joining sales_txn millions of rows against itself, grouping by customer pairs, and calculating overlap metrics. This is a batch operation that runs overnight, making it useless for real-time POS recommendations.

Neo4j Solution: Customer-to-customer SIMILAR_TO relationships are precomputed using Neo4j Graph Data Science (GDS) library algorithms like Node Similarity or K-Nearest Neighbours and written back as relationship properties. At query time, traversing the similarity network in Cypher is O(k) where k is the number of similar customers, returning recommendations in single-digit milliseconds. Neo4j GDS also provides community detection (Louvain, Label Propagation) to identify natural customer clusters beyond RFM segmentation.

customer product promotion dp_cust360 dp_custseg
Customer A VIP Gold | At Risk Customer B Churned Customer C Re-engaged Product X Leather Jacket Product Y Cashmere Scarf Promo P1 VIP 20% Off Segment: Premium Luxury SIMILAR 0.91 SIMILAR 0.87 PURCHASED PURCHASED RESPONDED_TO IN_SEGMENT
Customer Similarity Network: peer relationships power real-time recommendations and churn prediction
Neo4j Cypher: Churn-risk peer analysis
// Find what similar customers bought before churning MATCH (c:Customer {id: 'CUST-48291'}) -[sim:SIMILAR_TO]->(peer:Customer {status: 'churned'}) -[:PURCHASED]->(p:Product) WHERE sim.score > 0.8 RETURN p.name, p.category, count(peer) AS peer_count ORDER BY peer_count DESC LIMIT 10 // Find promotions that re-engaged similar customers MATCH (c:Customer {id: 'CUST-48291'}) -[sim:SIMILAR_TO]->(peer:Customer) -[:RESPONDED_TO]->(promo:Promotion) WHERE sim.score > 0.75 AND peer.status = 'active' RETURN promo.name, promo.type, count(peer) AS success_count
Stage 10: Promotion Stage 11: Purchase Stage 12: Consumption Stage 13: Feedback
Industry benchmarks show graph-powered recommendation engines deliver 15-35% higher conversion rates versus collaborative filtering on flat tables. Neo4j's real-time Cypher queries can serve recommendations at POS checkout latency (<50ms), while GDS algorithms (Node Similarity, FastRP embeddings) compute the underlying similarity scores as batch graph projections. For ShaDey Inc.'s projected e-commerce GMV, this translates to significant incremental revenue from personalised product placement.

4 Data Lineage & Governance

ShaDey Inc.'s governance framework defines a 4-layer certification model (CDM → LDM → PDM → Pipelines) with quality gates at each transition. The critical question during the SAP ECC → S/4HANA migration is: "If MARA changes to a new structure, which data products, dashboards, ML models, and downstream consumers break?" This is a lineage traversal problem.

Business Problem
Impact analysis for SAP migration and schema changes

Scenario: During the S/4HANA migration, SAP table MARA (material master) undergoes structural changes. The data engineering team needs to instantly identify every downstream consumer: which ETL pipelines read MARA, which PDM columns are derived from it, which data products (dp_prodcat, dp_salesdaily, dp_invpos) are affected, and which ML models (dp_demand, aiml_features) would produce incorrect predictions.

RDBMS Challenge: Lineage metadata is typically scattered across ETL tool catalogs, data dictionaries, and documentation. Even when centralised, querying "all downstream consumers N hops away" requires recursive CTEs that are expensive and hard to maintain.

Neo4j Solution: Every source table, column, transformation, data product, and consumer is a labeled node in Neo4j. Lineage relationships (FEEDS, TRANSFORMS, BUILDS, CONSUMED_BY) form a directed acyclic graph. Impact analysis is a single variable-length Cypher pattern *1..6 from the changed node. Neo4j's APOC library provides additional path expansion procedures (apoc.path.expandConfig) for fine-grained traversal control, and its built-in visualisation in Neo4j Browser makes lineage graphs immediately explorable by data stewards.

SAP Tables PDM Entities Data Products ML Models Dashboards
Neo4j Cypher: Migration impact analysis
// Trace all downstream consumers of SAP MARA table MATCH path = (src:SourceTable {name: 'MARA'}) -[:FEEDS|TRANSFORMS|BUILDS|CONSUMED_BY *1..6]->(downstream) RETURN downstream.name AS affected_object, downstream.type AS object_type, length(path) AS hops_from_source, downstream.owner AS data_owner ORDER BY hops_from_source // Find which quality rules are affected MATCH (src:SourceTable {name: 'MARA'})-[:FEEDS]->(col:PDMColumn) -[:HAS_QUALITY_RULE]->(rule:QualityRule) RETURN col.name, rule.type, rule.threshold, rule.last_passed
ECC Source S/4HANA Change Downstream Impact (Graph Traversal)
MARA / MAKT / MARC Product master simplified, MBEW merged product → dp_prodcat → dp_salesdaily → dp_demand → aiml_features
MSEG / MKPF Replaced by MATDOC inventory → dp_invpos → dp_demand (reorder signals break)
BSEG / BKPF Replaced by ACDOCA (Universal Journal) sales_txn → dp_netsales → dp_salesdaily → dp_storean
KNA1 / KNB1 Replaced by BUT000 (Business Partner) customer → dp_cust360 → dp_custseg → aiml_features
KONV Replaced by PRCD_ELEMENTS promotion → dp_promoeff → sales_txn pricing columns
ShaDey Inc.'s S/4HANA migration involves 7 major table restructurings documented across the platform. A Neo4j lineage graph makes each change a bounded, traceable event rather than a "change it and see what breaks" exercise. Every affected data product, ML model, and dashboard is identified before the migration begins. Neo4j Browser's graph visualisation allows data architects to interactively explore impact paths, and APOC export procedures can generate migration checklists directly from traversal results.

5 Product Substitution & Assortment Networks

When a product goes out of stock or is discontinued, ShaDey Inc. needs to recommend substitutes that overlap with the same customer segments. This requires traversing product-category-customer relationships to find alternatives that satisfy similar preferences, not just products in the same category.

Business Problem
Intelligent substitution and cannibalization detection

Scenario: ShaDey Inc.'s best-selling winter coat is out of stock at 12 stores. The merchandising team needs: (1) which other coats satisfy the same customer segment, (2) whether those substitutes are in stock at the affected stores, (3) whether recommending Product B will cannibalise Product C's sales, and (4) category gaps where no substitute exists.

Neo4j Solution: Products, categories, customer segments, and stores form a rich labeled property graph in Neo4j. Cypher traversals like Product → PREFERRED_BY → Segment → PREFERS → Product find customer-validated substitutes. Checking Product → IN_STOCK_AT → Store confirms availability. Neo4j GDS's Node Similarity algorithm quantifies product overlap by shared customer base, and the Jaccard coefficient on customer edges directly identifies cannibalization risk.

product store dp_invpos dp_custseg dp_prodcat
Neo4j Cypher: Intelligent product substitution
// Find customer-validated substitutes for out-of-stock product MATCH (p:Product {sku: 'COAT-WTR-001'}) -[:PREFERRED_BY]->(seg:Segment) -[:PREFERS]->(alt:Product) -[:IN_STOCK_AT]->(s:Store) WHERE alt.sku <> 'COAT-WTR-001' AND s.name IN ['Flagship NYC', 'Flagship LA', 'Outlet Chicago'] RETURN alt.name, alt.sku, alt.price, s.name AS store, seg.name AS segment_match // Detect cannibalization: products sharing 80%+ customer base MATCH (a:Product)-[:PURCHASED_BY]->(c:Customer)<-[:PURCHASED_BY]-(b:Product) WHERE a.category = 'Outerwear' AND a <> b WITH a, b, count(c) AS shared, size((a)-[:PURCHASED_BY]->()) AS total_a WHERE shared * 1.0 / total_a > 0.8 RETURN a.name, b.name, shared, total_a, round(shared * 100.0 / total_a) AS overlap_pct
Stage 7: Warehouse Stage 9: On Shelf Stage 14: Improvement

6 Order Fulfillment Path Optimisation

ShaDey Inc.'s dp_orderfulf data product tracks days-to-ship and on-time delivery flags. But optimising which distribution centre fulfils which store for which order is a shortest-path problem across the logistics network, a native graph operation.

Business Problem
Dynamic routing when a distribution centre goes offline

Scenario: ShaDey Inc.'s East Coast distribution centre is temporarily offline due to severe weather. 340 pending orders need to be rerouted to the next-best fulfilment location based on product availability, shipping cost, and delivery SLA constraints.

Neo4j Solution: The logistics network (DCs, stores, regions, carrier routes) is modelled as a weighted property graph in Neo4j. Each relationship carries cost, transit_days, and capacity properties. Neo4j Graph Data Science (GDS) library provides Dijkstra's shortest-path and A* algorithms as native procedures. The gds.shortestPath.dijkstra call finds the optimal rerouting for each order in real time, returning both total cost and the full path of intermediate nodes.

sales_order store shipment dp_orderfulf
Neo4j Cypher + GDS: Optimal rerouting
// Find cheapest alternative fulfilment path for each pending order MATCH (o:SalesOrder {status: 'pending'}) -[:SHIPS_FROM]->(dc:DC {name: 'DC-East'}) MATCH (o)-[:DELIVERS_TO]->(dest:Store) MATCH (alt_dc:DC)-[:STOCKS]->(p:Product) WHERE alt_dc.status = 'active' AND p.sku IN o.line_items CALL gds.shortestPath.dijkstra.stream('supply_chain_graph', { sourceNode: id(alt_dc), targetNode: id(dest), relationshipWeightProperty: 'cost' }) YIELD totalCost, path RETURN o.order_id, alt_dc.name, dest.name, totalCost ORDER BY totalCost LIMIT 1
Stage 8: Distribution Stage 11: Purchase

7 Dual Architecture: Star Schema + Neo4j

Neo4j complements ShaDey Inc.'s existing star schema. The data warehouse remains the analytical backbone for aggregation, rollups, and historical trend analysis. Neo4j handles real-time traversal, impact analysis, and relationship-intensive queries where join depth exceeds three hops. Data flows from SAP through the CDC pipeline into both systems. Neo4j's Kafka connector or custom APOC load procedures ingest change events, while the Neo4j Bolt protocol serves sub-50ms query responses to application layers.

Source
SAP ECC / S/4HANA
95+ source tables
Pipeline
ETL / CDC
Change data capture
OLAP
Star Schema DW
24 entities, aggregation
Graph
Neo4j Enterprise
Cypher + GDS + APOC
ML
Feature Store
Point-in-time serving
Query Type Routed To Example
Aggregation / Rollup Star Schema DW Monthly revenue by store, YoY growth, inventory turnover
Historical Trend Star Schema DW SCD Type 2 customer history, price change timeline
Impact Analysis Neo4j (Cypher) Supplier failure blast radius, migration impact, lineage
Similarity / Recommendation Neo4j (GDS) Customer peers, product substitutes, cross-sell
Path Optimisation Neo4j (GDS) Fulfilment routing, shortest delivery path
Prediction / Scoring ML Feature Store Demand forecast, customer segmentation, churn risk
Neo4j reads from the same CDC pipeline as the star schema via the Neo4j Kafka Connector or APOC periodic load procedures. No data duplication at the source. Entities that appear in both systems (customer, product, store, supplier) share the same surrogate keys as Neo4j node properties, enabling join-back to the warehouse when a Cypher query result needs enrichment with historical aggregates. Neo4j's Bolt driver protocol (available for Java, Python, .NET, Node.js, Go) integrates with existing application services.

8 Implementation Priority

Ranked by business impact, alignment with existing data model entities, and implementation complexity. Phase 1 use cases map directly to entities already modelled in the PDM and solve problems where the current RDBMS architecture requires expensive multi-hop joins.

01
Supply Chain Risk
Very High: recall and disruption mitigation, supplier alternate sourcing
Phase 1
02
Data Lineage
High: S/4HANA migration de-risking, governance automation
Phase 1
03
Customer Network
High: revenue uplift via real-time recommendations, churn prevention
Phase 2
04
Product Substitution
Medium-High: margin protection, assortment optimisation
Phase 2
05
Fulfillment Paths
Medium: logistics cost reduction, SLA improvement
Phase 3
Start with Supply Chain Risk and Data Lineage in Phase 1. Both map directly to entities already modelled in ShaDey Inc.'s PDM (supplier, product, customer, store, inventory, sales_order) and solve problems where the current star schema requires 4-5 table joins that degrade at scale. Neo4j can be populated from the same CDC pipeline via the Neo4j Kafka Connector, minimising infrastructure changes. Phase 2 use cases leverage Neo4j GDS algorithms (Node Similarity, Dijkstra, community detection) that require the Phase 1 graph to already be in place.

PDM Entity Coverage by Use Case

PDM Entity Supply Chain Customer Net. Lineage Substitution Fulfilment
customerAffectedCore nodeDownstreamSegment linkDestination
productCore nodePurchase edgeDownstreamCore nodeLine item
supplierCore nodeSource
storeStocked atDownstreamAvailabilityCore node
promotionResponse edge
sales_orderAt-risk ordersCore node
inventoryStock checkDownstreamAvailability
shipmentCore node
dp_cust360EnrichmentDownstream
dp_custsegSegmentationDownstreamSegment match
dp_prodcatDownstreamCategory link
dp_invposStockout signalDownstreamStock check
dp_demandDownstream
aiml_featuresSimilarityDownstream

9 Graph Modeling Across the Platform

Neo4j's graph approach extends across ShaDey Inc.'s advanced data modeling modules. The patterns shown here: relationship traversal, impact analysis, multi-hop reasoning, and algorithmic graph operations. These appear in multiple contexts across the platform. Explore how Neo4j integrates with other modeling paradigms and governance frameworks.

Graph modeling in Neo4j becomes more powerful when integrated with ShaDey Inc.'s broader data modeling ecosystem. Each module (Medallion, Data Vault, DDD, Semantic Layer, Governance, and CRM) contributes different perspectives on relationships and dependencies. Neo4j excels at exposing these cross-cutting patterns, enabling queries and algorithms that would be prohibitively expensive in traditional relational systems.