DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

Memgraph


Memgraph is a native fully distributed in-memory graph database built to handle real-time use-cases. It features full ACID-compliant transactions and strong consistency, and uses the RAFT algorithm for replication. It supports the standardized openCypher query language. Various graph algorithms are also shipped with the database, such as breadth first search and weighted shortest path. Memgraph is available on-premises or in-cloud, and is offered in a single node or distributed version.[04]

Source Code
https://github.com/memgraph/memgraph[02]
Country of Origin
GB
Start Year
2016 [15]
Project Types
Commercial, Open Source
Written in
C, C++
Supported Languages
C, C#, C++, Elixir, Go, Haskell, Java, JavaScript, PHP, Python, Ruby, Scala
Compatible With
Neo4j
Operating System
Linux

Database Entry

Memgraph


Memgraph is a native fully distributed in-memory graph database built to handle real-time use-cases. It features full ACID-compliant transactions and strong consistency, and uses the RAFT algorithm for replication. It supports the standardized openCypher query language. Various graph algorithms are also shipped with the database, such as breadth first search and weighted shortest path. Memgraph is available on-premises or in-cloud, and is offered in a single node or distributed version.[04]

History[05]


Memgraph is a graph database start-up that was founded in 2016 by Dominik Tomicevic and Marko Budiselic.

Checkpoints[06]


Snapshots are taken periodically during the runtime of Memgraph. When a snapshot is triggered, the whole data storage is written to disk. Database recovery is done on startup from the most recent snapshot file.

Concurrency Control[07]


Memgraph supports strongly-consistent ACID transactions and uses multi-version concurrency control.

Data Model[05]


Memgraph's underlying data model is the property graph model. A property graph consists of nodes and relationships (or vertices and edges). Nodes can hold any number of properties (key-value pairs) and can be assigned labels that represent their roles within a particular domain. For example, a node with a label "person" could have properties such as "name" or "age." Relationships are directed connections between two nodes and contain properties (just like nodes) as well as a single edge type. For example, a relationship in a graph of people can have the edge type "friend of," and a property "since."

Foreign Keys[08]


In graph data models, relationships are as important as the data itself. Thus foreign keys are not required to infer connections between entities.

Indexes[09]


The central part of Memgraph's index data structure is a highly-concurrent skip list.

Isolation Levels[05]


Memgraph’s implementation of MVCC provides snapshot isolation level.

Logging[06]


Memgraph uses write-ahead logging.

Parallel Execution[05]


Memgraph features a distributed query execution engine. Each query plan is divided into two: a plan that will be executed on the machine where the query is received and a plan that will be executed on the other machines. Nodes are allowed to exchange data during the execution process.

Query Compilation


Query Execution[10]


The execution of a query proceeds iteratively, generating one entry of the result set at a time.

Query Interface[11][12]


Memgraph supports the openCypher query language developed by Neo4j. It is a declarative language for querying graph databases. openCypher is an open-source project to standardize Cypher as the query language for graph processing.

Storage Architecture[06][13]


Although Memgraph is an in-memory database by default, it offers an option to store a certain amount of data on disk. A list of properties to be stored on disk can be passed in via the command line. It is recommended to use this feature on large, cold properties, i.e., properties that are rarely accessed. The storage location of a property cannot be changed while Memgraph is running. The user can, however, reload their database from snapshot and provide a different list of properties to store on disk.

Additionally, snapshots and the write-ahead log are stored on disk.

Storage Model[06]


Since Memgraph is a graph DBMS, data is stored in the form of graph elements: nodes and edges. Each graph element can contain various types of data.

Stored Procedures[14]


Although the openCypher initiative stems from the Neo4j's Cypher query language, Memgraph's openCypher implementation does not support certain Cypher constructs, such as stored procedures.

System Architecture


Views


Citations

18 sources
  1. Memgraph memgraph.com
  2. GitHub - memgraph/memgraph: High-performance open-source in-memory graph database for GraphRAG, AI memory, agentic AI, and real-time graph analytics. Cypher-compatible, built in C++. · GitHub github.com
  3. Memgraph documentation memgraph.com
  4. Frequently asked questions memgraph.com
  5. Memgraph memgraph.com
  6. Storage memory usage memgraph.com
  7. Memgraph database memgraph.com
  8. Comparing relational to graph database - Getting Started neo4j.com
  9. Indexes memgraph.com
  10. EXPLAIN clause memgraph.com
  11. Getting started with Memgraph memgraph.com
  12. openCypher · openCypher opencypher.org
  13. https://medium.com/p/89e6a8b41459/responses/show medium.com Dead — Check Archive
  14. Differences in Cypher implementation memgraph.com
  15. https://www.crunchbase.com/organization/memgraph#section-overview crunchbase.com
  16. https://github.com/memgraph/memgraph/commit/476d3a5e93c7ce9214c30dfa277917632b6ccd8b github.com
  17. https://github.com/memgraph/memgraph/commit/d60dc120eba1521ead3b65f5f9dee383bbeaf4a8 github.com
  18. https://github.com/memgraph/memgraph/commit/a617fc486cdfaafcd45f6da116fbaaf4553d8ffc github.com
Revision #20 Last Updated: