-
Notifications
You must be signed in to change notification settings - Fork 13
Add memgraph in supply chain workload #1366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: memgraph-in-mission-critical-workloads
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -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 | ||||||
|
||||||
<Callout type="info"> | ||||||
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. | ||||||
</Callout> | ||||||
|
||||||
## 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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## What is covered? | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Revisit the entire section because both links and content don't match the page |
||||||
|
||||||
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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```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. | ||||||
|
||||||
<CommunityLinks/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.