Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5e5b886
init
katarinasupe Mar 13, 2025
55ff98c
Merge branch 'main' into memgraph-3-2
katarinasupe Mar 28, 2025
17384d2
Merge branch 'main' into memgraph-3-2
katarinasupe Mar 28, 2025
46cfb1f
Add hardware sizing
Josipmrden Apr 15, 2025
ee9a7bb
Add vm.max_map_count explanation
Josipmrden Apr 15, 2025
de342fb
Add deployment options
Josipmrden Apr 15, 2025
0b741e8
Add flag set suggestions
Josipmrden Apr 15, 2025
e8353d3
Indentation
Josipmrden Apr 15, 2025
b63517e
Remove unnecessary comment
Josipmrden Apr 15, 2025
cf434bb
Add enterprise, queries and import sections
Josipmrden Apr 15, 2025
bfc44eb
Finish general suggestions guide
Josipmrden Apr 15, 2025
d3c71fe
Make under construction notes
Josipmrden Apr 15, 2025
1a5097f
Add todo
Josipmrden Apr 15, 2025
5de8cac
Update property sizes
Josipmrden Apr 16, 2025
d63d9d1
Add backup considerations
Josipmrden Apr 16, 2025
fd35d83
Added overview page
Josipmrden Apr 16, 2025
0042907
Add hardware sizing
Josipmrden Apr 15, 2025
6de5e65
Add vm.max_map_count explanation
Josipmrden Apr 15, 2025
60f1f25
Add deployment options
Josipmrden Apr 15, 2025
01f350e
Add flag set suggestions
Josipmrden Apr 15, 2025
74715a8
Indentation
Josipmrden Apr 15, 2025
a97f41a
Remove unnecessary comment
Josipmrden Apr 15, 2025
e8753c1
Add enterprise, queries and import sections
Josipmrden Apr 15, 2025
bcf7a0c
Finish general suggestions guide
Josipmrden Apr 15, 2025
89ce823
Make under construction notes
Josipmrden Apr 15, 2025
6c5e47f
Add todo
Josipmrden Apr 15, 2025
84f4d0c
Update property sizes
Josipmrden Apr 16, 2025
51f07a4
Add backup considerations
Josipmrden Apr 16, 2025
2d481aa
Added overview page
Josipmrden Apr 16, 2025
0126e49
Merge branch 'memgraph-in-production' of github.com:memgraph/document…
Josipmrden Apr 16, 2025
81d7788
Main
Josipmrden Apr 16, 2025
72f6649
Main
Josipmrden Apr 16, 2025
c27b99d
Newline
Josipmrden Apr 16, 2025
6d1c3c3
Merge branch 'main' into memgraph-in-production
Josipmrden Apr 16, 2025
c58d7c5
Add section for query timeout
Josipmrden Apr 17, 2025
6742f61
Set up lab features
Josipmrden Apr 17, 2025
5cedea6
Sentence case
Josipmrden Apr 17, 2025
2a3aa4e
Remove empty construction pages
Josipmrden Apr 17, 2025
313e61b
Add callout
Josipmrden Apr 17, 2025
1b5c5f3
Update GraphRAG use case
Josipmrden Apr 17, 2025
05e8b71
Finish memgraph in production for graphrag
Josipmrden Apr 24, 2025
2c7e98f
Merge branch 'main' into memgraph-in-production
Josipmrden Apr 24, 2025
7f2fcb2
Add graphrag link
Josipmrden Apr 24, 2025
53e1526
Address PR comments
Josipmrden Apr 25, 2025
c2e3641
Evaluating memgraph (#1263)
Josipmrden Apr 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pages/_meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export default {
"clustering": "Clustering",
"data-streams": "Data streams",
"help-center": "Help center",
"release-notes": "Release notes"
}
"release-notes": "Release notes",
"memgraph-in-production": "Memgraph in production"
}
53 changes: 36 additions & 17 deletions pages/fundamentals/storage-memory-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ Memgraph supports three different storage modes:
### Start Memgraph with a specific storage mode

By default, an empty instance will start using in-memory transactional storage
mode. To start Memgraph in the ON_DISK_TRANSACTIONAL or IN_MEMORY_ANALYTICAL
mode.
To start Memgraph in the `ON_DISK_TRANSACTIONAL` or `IN_MEMORY_ANALYTICAL`
storage node, change the `--storage-mode` [configuration
flag](/database-management/configuration) accordingly.

Expand All @@ -58,7 +59,7 @@ mode.

When switching modes, Memgraph will wait until all other transactions are done.
If some other transactions are running in your system, you will receive a
warning message, so be sure to [set the log level to
warning message, so be sure to [set the log level at least to
`WARNING`](/database-management/logs).

Switching from the in-memory storage mode to the on-disk storage mode is allowed
Expand Down Expand Up @@ -191,7 +192,9 @@ built-in behavior is as follows:
* [procedures](/advanced-algorithms/run-algorithms#run-procedures-from-mage-library): skip all records that contain any deleted value
* [functions](/querying/functions): return a null value

<Callout type="warning">
Please note that deleting same part of the graph from parallel transaction will lead to undefined behavior.
</Callout>

Users developing [custom query procedures and functions](/custom-query-modules) intended to work in the
analytical storage mode should use API methods to check if Memgraph is running
Expand Down Expand Up @@ -440,7 +443,7 @@ Estimating Memgraph's storage memory usage is not entirely straightforward
because it depends on a lot of variables, but it is possible to do so quite
accurately.

If you want to **estimate** memory usage in IN_MEMORY_TRANSACTIONAL storage mode, use the following formula:
If you want to **estimate** memory usage in `IN_MEMORY_TRANSACTIONAL` storage mode, use the following formula:

$\texttt{StorageRAMUsage} = \texttt{NumberOfVertices} \times 212\text{B} + \texttt{NumberOfEdges} \times 162\text{B}$

Expand Down Expand Up @@ -475,7 +478,7 @@ that the formula is correct.

### The calculation in detail

Let's dive deeper into the IN_MEMORY_TRANSACTIONAL storage mode memory usage
Let's dive deeper into the `IN_MEMORY_TRANSACTIONAL` storage mode memory usage
values. Because Memgraph works on the x86 architecture, calculations are based
on the x86 Linux memory usage.

Expand Down Expand Up @@ -557,19 +560,35 @@ value. So the layout of each property is:

$\texttt{propertySize} = \texttt{basicMetadata} + \texttt{propertyID} + [\texttt{additionalMetadata}] + \texttt{value}.$

| Value type | Size | Note
|-----------------------------|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|`NULL` | 1B + 1B | The value is written in the first byte of the basic metadata. |
|`BOOL` | 1B + 1B | The value is written in the first byte of the basic metadata. |
|`INT` | 1B + 1B + 1B, 2B, 4B or 8B | Basic metadata, property ID and the value depending on the size of the integer. |
|`DOUBLE` | 1B + 1B + 8B | Basic metadata, property ID and the value |
|`STRING` | 1B + 1B + 1B + min 1B | Basic metadata, property ID, additional metadata and lastly the value depending on the size of the string, where 1 ASCII character in the string takes up 1B. |
|`LIST` | 1B + 1B + 1B + min 1B | Basic metadata, property ID, additional metadata and the total size depends on the number and size of the values in the list. |
|`MAP` | 1B + 1B + 1B + min 1B | Basic metadata, property ID, additional metadata and the total size depends on the number and size of the values in the map. |
|`TEMPORAL_DATA` | 1B + 1B + 1B + min 1B + min 1B | Basic metadata, property ID, additional metadata, seconds, microseconds. Value of the seconds and microseconds is at least 1B, but probably 4B in most cases due to the large values they store. |
|`ZONED_TEMPORAL_DATA` | `TEMPORAL_DATA` + 1B + min 1B | Like `TEMPORAL_DATA`, but followed by timezone name length (1 byte) and string (1 byte per character). |
|`OFFSET_ZONED_TEMPORAL_DATA` | `TEMPORAL_DATA` + 2B | Like `TEMPORAL_DATA`, but followed by the offset from UTC (in minutes; always 2 bytes). |
|`ENUM` | 1B + 1B + 2B, 4B, 8B or 16B | Basic metadata, property ID and the value depending on required size representation required. |
| Value type | Sizing in detail | Total estimated size | Note
|-----------------------------|--------------------------------|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|`NULL` | 0B | 0B | Memgraph treats null values same as if they're not present. Therefore, `NULL` values are not stored in the property store. |
|`BOOL` | 1B + 1B | 2B | The value is written in the first byte of the basic metadata. |
|`INT` | 1B + 1B + 1B, 2B, 4B or 8B | 3B - 10B | Basic metadata, property ID and the value depending on the size of the integer. |
|`DOUBLE` | 1B + 1B + 8B | 10B | Basic metadata, property ID and the value |
|`STRING` | 1B + 1B + 1B + min 1B | at least 4B | Basic metadata, property ID, additional metadata and lastly the value depending on the size of the string, where 1 ASCII character in the string takes up 1B. |
|`LIST` | 1B + 1B + 1B + min 1B | at least 4B (empty) | Basic metadata, property ID, additional metadata and the total size depends on the number and size of the values in the list. |
|`MAP` | 1B + 1B + 1B + min 1B | at least 4B (empty) | Basic metadata, property ID, additional metadata and the total size depends on the number and size of the values in the map. |
|`TEMPORAL_DATA` | 1B + 1B + 1B + min 1B + min 1B | 12B | Basic metadata, property ID, additional metadata, seconds, microseconds. Value of the seconds and microseconds is at least 1B, but probably 4B in most cases due to the large values they store. |
|`ZONED_TEMPORAL_DATA` | `TEMPORAL_DATA` + 1B + min 1B | at least 14B | Like `TEMPORAL_DATA`, but followed by timezone name length (1 byte) and string (1 byte per character). |
|`OFFSET_ZONED_TEMPORAL_DATA` | `TEMPORAL_DATA` + 2B | at least 14B | Like `TEMPORAL_DATA`, but followed by the offset from UTC (in minutes; always 2 bytes). |
|`ENUM` | 1B + 1B + 2B, 4B, 8B or 16B | 4B - 18B | Basic metadata, property ID and the value depending on required size representation required. |

Users can additionally inspect the exact size of a property in bytes using the [propertySize()](/querying/functions#scalar-functions) function.
The query usage is the following:
```cypher
MATCH (n)
RETURN n.id AS id, propertySize(n, "id") AS prop_size_bytes;
```

Output:
```output
+-----------+-----------------+
| id | prop_size_bytes |
+-----------+-----------------+
| 1 | 3 |
+-----------+-----------------+
```

### Marvel dataset use case

Expand Down
23 changes: 13 additions & 10 deletions pages/getting-started/install-memgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,20 @@ Before running Memgraph, please check the [system configuration guidelines](/dat

Below are minimum and recommended system requirements for installing Memgraph.

| | Minimum | Recommended |
| ------- | -------- | ------------------------------ |
| | Minimum | Recommended |
| ------- | -------- | ------------------------------- |
| CPU | Server or desktop processor: <br/> Intel Xeon <br/> AMD Opteron/Epyc <br/> ARM machines or Apple M1 <br/> Amazon Graviton | Server processor: <br/> Intel Xeon <br/> AMD Opteron/Epyc <br/> ARM machines or Apple M1 <br/> Amazon Graviton |
| RAM | 1 GB | ≥ 16 GB ECC |
| Disk | 1 GB | equally as RAM |
| Cores | 1 vCPU | ≥ 8 vCPUs (≥ 4 physical cores) |
| Network | 100 Mbps | ≥ 1 Gbps |

The disk is used for storing database [durability
files](/configuration/data-durability-and-backup) - snapshots and write-ahead
logs.
| RAM | 1 GB | ≥ 16 GB ECC |
| Disk | 1 GB | at least 3x the amount of RAM (NVMe SSD) |
| Cores | 1 vCPU | ≥ 8 vCPUs (≥ 4 physical cores) |
| Network | 100 Mbps | ≥ 1 Gbps |

The disk is used for storing database [durability files](/configuration/data-durability-and-backup), including snapshots and write-ahead
logs. By default, Memgraph stores the **three most recent snapshots** in the database (this can be configured using the `--storage-snapshot-retention-count` flag).
Snapshots size is usually less than the amount of RAM that is needed to load the data into memory.

The number of CPU cores required depends on your specific use case. For horizontal scalability, you can increase the number of
available cores on your system for additional scalability.

Check out how the [storage memory](/fundamentals/storage-memory-usage) is used,
and calculate memory requirements based on your data.
78 changes: 78 additions & 0 deletions pages/memgraph-in-production.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
---
title: Memgraph in production
description: Learn how to deploy Memgraph in production for your workload and consider all the advices directly from the Memgraph Team based on our multi-year experiences.
---

import { Callout } from 'nextra/components'
import {CommunityLinks} from '/components/social-card/CommunityLinks'

# Memgraph in production

When deploying Memgraph in production, it is essential to consider a set of prerequisites to ensure optimal **performance**, **scalability**
and **resilience**. That includes decisions about hardware configurations and integration strategies.

This guide is your starting point to production-readiness with Memgraph.

## ✅ What you'll need to consider

Before you dive into specific setups, it's important to think about:
- **Hardware requirements** and **instance sizing**
- **Driver configuration**
- **Flags** when starting Memgraph
- **Data import** best practices
- Connecting to **external sources**

These factors ensure Memgraph performs effectively in your environment, no matter the use case.

## 📖 How to use these guides

Start with the [General suggestions](/memgraph-in-production/general-suggestions). They cover **best practices** that apply to most
production deployments, regardless of your workload type and are **agnostic to specific use cases**.
Each separate guide in the *Memgraph in Production* series focuses on a particular type of workload or deployment scenario.
At the beginning of each guide, you’ll find information about:
- When that **use case** is a good fit for your needs.
- Specific tailored **recommendations**

⚠️ Recommendations in those guides **override** anything written in the
general suggestions when there's a conflict, so always defer to the targeted guide when applicable.


## 📚 Available guides in the *Memgraph in production* series

Here are the currently available guides to help you deploy Memgraph effectively:

### [General suggestions](/memgraph-in-production/general-suggestions)
A foundational guide covering universal best practices for any production deployment - recommended reading before anything else.

### [Memgraph in GraphRAG use cases](/memgraph-in-production/memgraph-in-graphrag)
Learn how to optimize Memgraph for Retrieval-Augmented Generation (RAG) systems using graph data.

## 🚧 Guides in construction
- Memgraph in transactional workloads
- Memgraph in analytical workloads
- Memgraph in mission critical workloads
- Memgraph in high throughput workloads
- Memgraph in supply chain use cases
- Memgraph in cyber security use cases
- Memgraph in fraud detection use cases

<Callout type="info">
If you'd like to help us **prioritize** this content, feel free to reach out on [Discord](https://discord.gg/memgraph)! 💬
Your feedback helps us build what matters most. 🙌
</Callout>

## 👀 Additional guides to consider when bringing your app to production

In addition to the core *Memgraph in Production* series, there are a number of complementary guides designed to
help you better prepare your environment, validate Memgraph’s fit for your workload, and ensure a
smooth transition to production.

These guides focus on areas like performance benchmarking, testing, and operational readiness—offering additional tools
and frameworks that can help you get the most out of your Memgraph deployment.

### [📊 Evaluating Memgraph](/memgraph-in-production/evaluating-memgraph)
Learn how to properly **test Memgraph for performance and scalability**.
This guide walks you through performance and stress testing scenarios, benchmarking with real-world data,
and identifying key metrics that can help validate Memgraph’s fit for your application needs.

<CommunityLinks/>
5 changes: 5 additions & 0 deletions pages/memgraph-in-production/_meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
"general-suggestions": "General suggestions",
"memgraph-in-graphrag": "Memgraph in GraphRAG use cases",
"benchmarking-memgraph": "Benchmarking Memgraph",
}
Loading