From 94c364615e04ac03c6bacd3ea02fa48ea3155d8a Mon Sep 17 00:00:00 2001 From: Memgraph Date: Tue, 19 Aug 2025 13:31:54 +0200 Subject: [PATCH] Add memgraph in supply chain workload --- pages/deployment/workloads.mdx | 4 +- pages/deployment/workloads/_meta.ts | 1 + .../workloads/memgraph-in-supply-chain.mdx | 157 ++++++++++++++++++ 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 pages/deployment/workloads/memgraph-in-supply-chain.mdx diff --git a/pages/deployment/workloads.mdx b/pages/deployment/workloads.mdx index 83202ddf6..bcddbd113 100644 --- a/pages/deployment/workloads.mdx +++ b/pages/deployment/workloads.mdx @@ -47,11 +47,13 @@ Scale your write throughput while keeping up with fast-changing, high-velocity g ### [Memgraph in GraphRAG use cases](/deployment/workloads/memgraph-in-graphrag) Learn how to optimize Memgraph for Retrieval-Augmented Generation (RAG) systems using graph data. +### [Memgraph in supply chain](/deployment/workloads/memgraph-in-supply-chain) +Use Memgraph for root-cause analysis, what‑if impact analysis, constraint-based pathfinding, and many more other use cases across your supply chain network. + ## 🚧 Guides in construction - Memgraph in transactional workloads - Memgraph in analytical workloads - Memgraph in mission critical workloads -- Memgraph in supply chain use cases - Memgraph in fraud detection use cases diff --git a/pages/deployment/workloads/_meta.ts b/pages/deployment/workloads/_meta.ts index 0c82c3992..0e2576b78 100644 --- a/pages/deployment/workloads/_meta.ts +++ b/pages/deployment/workloads/_meta.ts @@ -3,4 +3,5 @@ export default { "memgraph-in-graphrag": "Memgraph in GraphRAG use cases", "memgraph-in-high-throughput-workloads": "Memgraph in high-throughput workloads", "memgraph-in-mission-critical-workloads": "Memgraph in mission critical workloads", + "memgraph-in-supply-chain": "Memgraph in supply chain", } diff --git a/pages/deployment/workloads/memgraph-in-supply-chain.mdx b/pages/deployment/workloads/memgraph-in-supply-chain.mdx new file mode 100644 index 000000000..3d7273df3 --- /dev/null +++ b/pages/deployment/workloads/memgraph-in-supply-chain.mdx @@ -0,0 +1,157 @@ +--- +title: Memgraph in supply chain +description: Suggestions on how to bring your Memgraph to production in supply chain use cases. +--- + +import { Callout } from 'nextra/components' +import { CommunityLinks } from '/components/social-card/CommunityLinks' + +# Memgraph in supply chain + + +Before diving into this guide, we recommend starting with the [Deployment best practices](/deployment/best-practices) +page. It provides foundational, use-case-agnostic advice for deploying Memgraph in production. + +This guide builds on that foundation, offering additional recommendations tailored to supply chain workloads. +In cases where guidance overlaps, consider the information here as complementary or overriding, depending on the +unique needs of your use case. + + +## Is this guide for you? + +This guide is for you if you're operating a supply chain network where visibility, optimization, and resilience are critical. +You'll benefit from this content if: + +- You need to perform **root-cause analysis** across your supply chain to identify **bottlenecks and delays** (e.g., why an order is late, which supplier/route/warehouse is the cause). +- You want to run **impact analysis (what‑if scenarios)** to evaluate downstream effects of investing in your topology, or changing the configuration and behaviour of your assets, without compromising the original graph structure. +- You need **multi-hop pathfinding** with complex business logic routing capabilities. +- You want to maintain a **digital twin** of your supply chain to track and monitor changes in real-time with an observability system. +- You ingest events from **ERP/IoT** systems and need consistent read performance while updates are continuously applied. + +## Why choose Memgraph for supply chain use cases? + +- **In-memory architecture**: Delivers consistent, predictable response times for interactive planning, diagnostics, and operational dashboards. +- **Path traversals with advanced filtering**: Memgraph’s deep path traversal capabilities provide superior, flexible pathfinding with + rich filtering, hop limits, and custom cost functions—ideal for complex business constraints like capacity, carrier rules, and time windows. Learn more in the + [Deep path traversal algorithms](/advanced-algorithms/deep-path-traversal). +- **Non-blocking reads and writes (MVCC)**: Ensure planners and operators get fast insights while real-time updates flow from upstream systems. +- **Snapshot isolation by default**: Guarantees consistent views of the network for reproducible analysis and decision-making. +- **Fine-grained access control (RBAC and label-based)**: Enforce privilege access for planners, partners, and vendors so users only see what they should. +- **Graph visualization (Memgraph Lab)**: Focus your experts on the relevant subgraph with tailored views, filters, and layouts to make faster, better decisions. + +## What is covered? + +The suggestions for supply chain workloads complement several key sections in the +[general suggestions guide](/deployment/best-practices). These sections offer important context and +additional best practices tailored for performance, stability, and scalability in production: + +- [Choosing the right Memgraph flag set](/deployment/best-practices#choosing-the-right-memgraph-flag-set) + Optimize runtime behavior for streaming updates and long-running analytics. + +- [Choosing the right Memgraph storage mode](/deployment/best-practices#choosing-the-right-memgraph-storage-mode) + Select between transactional durability and multithreaded ingestion for your workload. + +- [Enterprise features you might require](#enterprise-features-you-might-require) + Secure multi-user environments and ensure governance. + +- [Queries that best suit your workload](#queries-that-best-suit-your-workload) + Keep writes idempotent and design traversal queries for reliability and speed. + +- [Importing mechanisms](#importing-mechanisms) + Plan ingestion from streams and batch sources (ERP/WMS/TMS/IoT). + +## Choosing the right Memgraph flag set + +Supply chain updates often arrive as standardized messages where not every property changes. +To reduce write overhead during high-throughput ingestion, consider: + +```bash +--storage-delta-on-identical-property-update=false +``` + +With this setting, Memgraph creates delta records only for properties that actually changed, improving throughput when many updates repeat existing values. +All available flags are listed in the [Configuration](/database-management/configuration) section. This flag is commonly useful when you're using batch +imports in bulk, or streaming imports where a subset of the properties changes while the rest remain standardized. + +If you plan to power natural-language interfaces for operators and planners (see GraphRAG below), enable constant-time schema retrieval: + +```bash +--schema-info-enabled=true +``` + +This drastically reduces time to provide schema to an LLM, improving responsiveness. + +## Choosing the right Memgraph storage mode + +Supply chain systems vary between operational (durable) and analytical (what‑if, simulations) needs. +Use the mode that best aligns with your requirements: + +- Use `IN_MEMORY_TRANSACTIONAL` if you require **ACID guarantees**, **replication**, or **high availability**. +- Use `IN_MEMORY_ANALYTICAL` if you prioritize **multithreaded ingestion**, **simulations**, or **read-only analytics** where you don’t need transactional rollback. + +Learn more about storage modes in the [Storage memory usage](/fundamentals/storage-memory-usage#storage-modes) documentation. + +## Importing mechanisms + +Memgraph natively integrates with **data streams** (e.g., Kafka) and supports **batch imports**. For multi-source supply chain data (ERP/IoT): + +- Use drivers or native stream integrations for near-real-time updates. +- If you have multiple concurrent writers, use drivers with **retryable (managed) transactions** to handle transient conflicts during bursts. +- Keep ingestion **idempotent** to allow safe replays. + +See [Data streams](/data-streams) and the high-throughput guide’s advice on +[conflicting transactions](/help-center/errors/transactions#conflicting-transactions). + +## Optimizing supply chain analysis + +### Deep path traversals for routing and what‑if analysis +Use deep path traversals to compute feasible routes under complex business rules (capacity, cost, time windows, risk exposure): + +```cypher +// Example: cost-aware pathfinding from a supplier to a store with custom weight +MATCH path=(s:Supplier {id: $supplierId})-[:ROUTES_TO|SUPPLIES*WSHORTEST (r, n | coalesce(r.cost, 1)) total_cost]->(t:Store {id: $storeId}) +RETURN path, total_cost; +``` + +You can filter expansions by properties (e.g., allowed carriers, max lead time, geo restrictions), upper-bound hops, +or composite weights. See +[Deep path traversal algorithms](/advanced-algorithms/deep-path-traversal). + +### Map properties and nested indices +Supply chains often carry rich, semi-structured payloads (e.g., shipment/ASN details, customs data). Store JSON-like maps and index nested fields: + +```cypher +CREATE INDEX ON :Shipment(details.status); +``` + +Nested indices speed up filters like `WHERE shipment.details.status = 'IN_TRANSIT'` without over-normalizing your model. +Learn more about indices in [Indexes](/fundamentals/indexes#label-property-index). + +## Enterprise features you might require + +- **Role-based access control (RBAC) and label-based access control (LBAC)** + Ensure users only access data they are permitted to see—e.g., region-specific planners, vendor portals, or carrier-limited views. Learn more in + [Role-based access control](/database-management/authentication-and-authorization/role-based-access-control). + +- **Replication and high availability** + Keep planning and operational systems online with leader–replica setups and automatic failover. See + [High availability](/clustering/high-availability) and [Replication](/clustering/replication). + +- **Multi-tenancy** + Isolate per business unit, brand, or customer. See [Multi-tenancy](/database-management/multi-tenancy). + +## Interact with your supply chain using GraphRAG + +Out of the box, you can enable natural-language interaction over your supply chain graph using GraphRAG tools and GraphChat in Memgraph Lab. +This is especially useful for non-technical users who want quick answers like “Why is order 12345 late?” or “What’s the cheapest route if port X is congested?” + +- See the dedicated guide: [Memgraph in GraphRAG use cases](/deployment/workloads/memgraph-in-graphrag) +- When integrating with open-source frameworks, include constant-time schema retrieval in your pipeline: + +```cypher +SHOW SCHEMA INFO; +``` + +This helps LLMs construct valid Cypher quickly. + +