Durability: How MemSQL Keeps Your Data Safe

Enterprise-Ready Durability Features of MemSQL

MemSQL is an in-memory database with enterprise-ready durability features. Memory is fast but volatile, and an in-memory database requires robust mechanisms for preventing data loss. The MemSQL architecture enables organizations to keep their data safe without introducing latency. MemSQL has three mechanisms for ensuring not only disk-based durability, but that your database and business stay online: logs and snapshots to disk for durability, redundancy for high availability, and cross-datacenter replication for disaster recovery.

Persistent Logs and Snapshots for Durability

MemSQL continuously logs transactions and periodically takes a full database snapshot, both of which are persisted to disk. To restore a database, MemSQL loads the most recent snapshot and replays remaining transactions from the log. The granularity of logging and frequency of snapshots are both configurable. Because MemSQL only writes logs and snapshots to disk, all disk I/O is sequential.


In-memory writes are serialized into a transaction buffer. A background process pulls groups of transactions and logs them on disk. It is possible to set the transaction buffer size to zero bytes, such that a transaction is not fully committed until it has been logged on disk. However, in practice the transaction buffer is very efficient and this is almost never necessary.

Redundancy for High Availability

MemSQL allows you to store a redundant copy of data within a cluster. Leaf nodes are organized into availability groups such that each node is paired with a node in the other availability group. Paired leaf nodes replicate data to one another, and can be configured to do so synchronously or asynchronously. Should a leaf node go offline, MemSQL automatically fails over to its replication partner.


Replication is managed on a per-partition basis. Roughly half the partitions contained on a leaf node will be masters and half will be slave/replicas. This helps MemSQL achieve greater parallelism on writes because every leaf node is active. In the case of failover, the slave partitions on the online node are promoted to master and can be written to immediately.

Cross-Datacenter Replication for Disaster Recovery

MemSQL supports fully automatic cross-datacenter replication that can be provisioned with a single command. The secondary (replica) cluster stores a read-only copy of data asynchronously replicated from the primary cluster. In the event of a major failure in the primary cluster, MemSQL allows you to promote the secondary cluster, immediately making it a "full" MemSQL cluster. In addition to providing disaster recovery assurance, the secondary cluster can also be used for heavy read-only workloads.

Download MemSQL and MemSQL Ops and see why leading companies are managing their data with MemSQL.

To discuss your real-time analytics needs with a MemSQL expert, please contact us at
855-4-MEMSQL (463-6775) or info@memsql.com. MemSQL Headquarters 534 4th Street, San Francisco, CA 94107