# Replication with Memgraph <sup style={{ fontSize: '0.6em', color: '#888' }}>Community</sup>

Replication allows you to **copy data from one Memgraph instance (MAIN) to one
or more REPLICA instances**. This improves **read scalability**, provides
**extra copies of your data** and can reduce the impact of individual node
failures.

In a replication setup:

- The **MAIN** instance accepts **reads and writes**.
- **REPLICA** instances accept **reads only** and continuously replicate data
  from the MAIN.

Replication is a good fit if you:

- Want to scale read workloads horizontally.
- Need additional copies of your data for resilience.
- Are comfortable managing **manual failover** and cluster orchestration
  yourself.

> **Info**
>
> This guide is for **Memgraph Community** users who want to set up data
> replication across multiple instances. If you have a **Memgraph Enterprise**
> license, we strongly recommend using the [high availability
> features](https://memgraph.com/docs/clustering/high-availability) instead.
>
> High availability (HA) builds on replication and adds:
> - **Automatic failover** (no manual promotion of replicas),
> - **Coordinator instances** based on the Raft consensus protocol,
> - **Built-in routing** and better protection against data loss,
> - A more robust platform for true **24/7 uptime**.

> **Note**
>
> Before you start, we recommend reading **[replication under the hood
> section](https://memgraph.com/docs/clustering/replication/how-replication-works)** to understand the
> underlying concepts: roles (MAIN / REPLICA), replication modes (**SYNC**,
> **ASYNC**, **STRICT_SYNC**), durability (snapshots, WAL, deltas), and replica
> recovery behavior.

---

## What you'll find in this section

This **Replication** section focuses on the *practical* side of
setting up and operating a replication cluster. Use it as your entry point to:

- Choose a deployment method (Docker or Kubernetes),
- Apply best practices for reliability and performance,
- Use the available commands to manage and inspect the cluster.

### [How replication works](https://memgraph.com/docs/clustering/replication/how-replication-works)

Learn how Memgraph replication works under the hood, including:

- CAP theorem trade-offs  
- Roles of **MAIN** and **REPLICA**  
- How data is replicated using deltas, WALs, and snapshots  
- Replica states and recovery  
- Replication modes (**ASYNC**, **SYNC**, **STRICT_SYNC**) and their guarantees  
- How replicas catch up after interruptions  
- Multi-tenant replication (Enterprise)  
- Key internals such as timestamps, epoch IDs, and durability handling

A deeper look at how Memgraph maintains consistency, performance, and resilience
across replicated instances.

### [Set up replication cluster using Docker](https://memgraph.com/docs/clustering/replication/setup-replication-cluster-docker)

Create a local replication cluster using Docker.  
This guide walks through running one MAIN and two REPLICA instances, configuring
SYNC/ASYNC modes, and verifying that data is replicated correctly.

This is the recommended starting point if you are experimenting locally or
running simple container-based deployments.

### [Set up replication cluster on K8s](https://memgraph.com/docs/clustering/replication/setup-replication-cluster-k8s)

Deploy a replication cluster on Kubernetes using your own manifests or the
standalone Helm chart.  
Memgraph currently **does not** provide official Helm charts for the Community
edition, so this guide focuses on using raw Kubernetes manifests and concepts.

### [Replication best practices](https://memgraph.com/docs/clustering/replication/best-practices)

Guidelines for choosing replication modes, configuring storage, sizing hardware,
setting flags, managing manual failover, and running replication safely in
Memgraph Community.

### [Replication commands reference guide](https://memgraph.com/docs/clustering/replication/replication-commands-reference)

A complete list of all Community Edition replication commands, including role
changes, replica registration, monitoring, and cluster maintenance operations.
