====== Memgraph ====== Memgraph is an open-source, in-memory graph database built in C++ for high-throughput, low-latency transactional and analytical workloads. Fully compatible with the openCypher query language, Memgraph is designed for real-time streaming graph applications where microsecond-level query response times are critical. ((Source: [[https://memgraph.com/memgraphdb|Memgraph Official Website]])) Founded in 2016 in Zagreb, Croatia by software engineers **Dominik Tomicevic** and **Marko Budiselic**, the company has raised approximately **$14.2 million** in funding from investors including Microsoft's M12, Heavybit Industries, In-Q-Tel, Counterview Capital, Mundi Ventures, and Techstars. ((Source: [[https://siliconangle.com/2021/10/05/graph-database-startup-memgraph-lands-9-34m-seed-funding/|SiliconANGLE - Memgraph Seed Funding]])) ((Source: [[https://tracxn.com/d/companies/memgraph/|Tracxn - Memgraph Company Profile]])) ===== Architecture ===== Memgraph uses a **hybrid in-memory property graph architecture** optimized for speed through its C++ implementation, avoiding JVM garbage collection pauses that affect Java-based graph databases. ((Source: [[https://memgraph.com/memgraphdb|Memgraph Platform Overview]])) Key architectural features include: * **In-memory storage** -- nodes and edges reside in RAM for microsecond to low-millisecond query response times * **Durability** -- write-ahead logs (WAL) and periodic snapshots provide crash recovery * **Concurrency** -- fine-grained locking, lock-free skiplists, and Multi-Version Concurrency Control (MVCC) prevent writer-reader blocking * **Storage modes** -- three modes for transactional, analytical, or large-dataset workloads exceeding available RAM * **ACID compliance** -- full transactional guarantees with in-memory persistence * **Encryption in transit** -- secure data communication between clients and the database ===== High Availability ===== Memgraph supports automatic failover through a coordinator service using the Raft consensus protocol (implemented via NuRaft in C++). ((Source: [[https://memgraph.com/docs/clustering/high-availability/ha-reference-architectures|Memgraph HA Reference Architectures]])) * The **Community Edition** offers WAL-based replication * The **Enterprise Edition** adds cluster coordinators, multi-tenancy with role-based access control, and multi-data-center deployment support * A leader coordinator manages replicas for reads and writes, supporting configurations such as MAIN + REPLICA across multiple data centers Scalability is primarily **vertical** (more RAM and CPU cores), with replication providing read scaling. Write operations are directed to a single MAIN instance. ===== Cypher Query Language ===== Memgraph natively supports **openCypher**, providing high compatibility with Neo4j's Cypher query language. This allows developers familiar with Neo4j to transition with minimal query modifications. ((Source: [[https://memgraph.com/docs/|Memgraph Documentation]])) The platform extends query capabilities through the **MAGE** (Memgraph Advanced Graph Extensions) library, which provides: * Pre-optimized graph algorithms including BFS, DFS, Weighted Shortest Path, and All Shortest Paths * User-defined graph analytics modules and procedures * Community-contributed algorithm implementations * Python, C, and C++ extensibility for custom procedures ===== Real-Time Analytics ===== Memgraph is specifically designed for **real-time graph computing**, evolving static graphs into active, event-driven systems: ((Source: [[https://python.plainenglish.io/memgraph-real-time-graph-computing-for-modern-data-systems-1ae9788edef6|Plain English - Memgraph Real-Time Graph Computing]])) * Highly concurrent data ingestion for always-fresh graph data * On-the-fly triggers, algorithms, and rules on incoming data streams * **Dynamic algorithms** that recalculate only changed analytical results rather than reprocessing entire graphs * Native integration with Apache Kafka and other streaming platforms * Support for over 1,000 transactions per second in high-velocity environments Ideal use cases include fraud detection, cybersecurity threat analysis, real-time recommendation engines, network monitoring, and IoT data processing. ===== Memgraph vs Neo4j ===== ^ Category ^ Memgraph ^ Neo4j ^ | Core storage | In-memory with WAL/snapshots | Disk-based with page cache | | Implementation | C++ (no GC pauses) | Java/JVM | | Query language | openCypher | Cypher | | Extensibility | MAGE library | APOC/GDS libraries, Java UDFs | | Scalability | Vertical (RAM/CPU) + replication | Horizontal (Causal Clustering, Fabric) | | Best for | Real-time streaming, low-latency | Large persistent graphs, complex analytics | | Consistency | Strong on primaries | Causal with bookmarks | | Fault tolerance | Replication with eventual consistency | 2F+1 primaries tolerating F faults | Memgraph excels in streaming and real-time workloads where data fits in RAM, while Neo4j is better suited for massive, durable graph datasets requiring horizontal scaling. ((Source: [[https://www.puppygraph.com/blog/memgraph-vs-neo4j|PuppyGraph - Memgraph vs Neo4j]])) ===== Memgraph Lab ===== Memgraph Lab is the visual interface for interacting with the database. Version 3.0 introduced: ((Source: [[https://memgraph.com/blog/memgraph-lab-3-0-overview|Memgraph Lab 3.0 Overview]])) * **Parallel GraphChat** -- an AI-powered Cypher assistant supporting multi-threaded model comparison and debugging * **Auto-updating schema** -- displays node and relationship counts and property distributions for faster query development * **Cluster management visibility** -- shows leader/follower roles to prevent accidental writes to replicas ===== See Also ===== * [[neo4j|Neo4j]] * [[graph_databases|Graph Databases]] * [[apache_kafka|Apache Kafka]] ===== References =====