How Does Memgraph Ensure Data Durability?
Blog post from Memgraph
Memgraph, an ACID-compliant graph database, ensures data durability by implementing Write-Ahead Logging (WAL) and checkpoints, which allow changes to be logged before committing to ensure persistence with minimal runtime overhead. Unlike shadow paging, which has been largely abandoned due to inefficiencies, WAL combined with checkpoints offers a more efficient approach by periodically serializing the entire graph to disk, thus clearing the WAL buffer and balancing runtime overhead with memory usage. Memgraph employs delta storage and undo chains for recovery purposes, converting them into redo chains when necessary, which facilitates efficient data recovery. To maintain consistency during snapshot-taking in a concurrent environment, Memgraph uses a separate transaction with a snapshot isolation level, allowing read-write operations on vertices and edges to continue without interference.