From 09c10492658ae8a85ad279ee532b29cf97b47c6a Mon Sep 17 00:00:00 2001 From: Jason Fulghum Date: Tue, 3 Sep 2024 14:44:16 -0700 Subject: [PATCH] Updating reference for Dolt-to-MySQL replication --- packages/dolt/content/guides/binlog-replication.md | 5 ++--- .../content/reference/sql/server/replication.md | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/dolt/content/guides/binlog-replication.md b/packages/dolt/content/guides/binlog-replication.md index 827545f23..00ea34ee5 100644 --- a/packages/dolt/content/guides/binlog-replication.md +++ b/packages/dolt/content/guides/binlog-replication.md @@ -2,10 +2,11 @@ title: MySQL to Dolt Replication (Preview) --- -Dolt binlog replication allows a Dolt SQL Server to consume binlog replication events from a MySQL or MariaDB source database. This is a convenient way to try out Dolt in an existing system – there is no need to migrate your database, just configure Dolt as a replica and as your data replicates to the Dolt server, it will build up a commit history. You can access all the data versioning features of Dolt from the Dolt replica to audit how your data has changed, recover deleted data, or view the state of your data at any point in time. +MySQL to Dolt replication allows a Dolt SQL Server to consume binlog replication events from a MySQL or MariaDB source database. This is a convenient way to try out Dolt in an existing system – there is no need to migrate your database, just configure Dolt as a replica and as your data replicates to the Dolt server, it will build up a commit history. You can access all the data versioning features of Dolt from the Dolt replica to audit how your data has changed, recover deleted data, or view the state of your data at any point in time. ![Binlog replication](../.gitbook/assets/dolt-binlog-replication.png) +If you're looking for to replicate data in the opposite direction (i.e. where the Dolt server is the primary and the MySQL server is the replica), check out [our blog post on Dolt to MySQL replication](https://www.dolthub.com/blog/2023-02-17-binlog-replication-preview). ## Requirements for MySQL Primary Server @@ -84,8 +85,6 @@ Clear out replication source and filtering configuration: `RESET REPLICA ALL;` **Syntax gaps** – Dolt aims for 100% compatibility with MySQL, but there are still some gaps in supported syntax that we're actively working on filling in. Overall, Dolt supports the **vast** majority of MySQL's syntax, although you may still find a statement that executes on the MySQL primary, but won't execute on the Dolt read-replica because of a syntax gap. Please [let us know](https://github.com/dolthub/dolt/issues/new) if you hit this so we can help find a temporary workaround and fill in the syntax gap for you. -**Replica mode only** – Dolt can only consume binlog events as a replica; it cannot act as a primary and produce binlog events. - **Replication channels** – only the default replication channel ("") is supported. **Replica filters** – We currently support only the `REPLICATE_DO_TABLE` and `REPLICATE_IGNORE_TABLE` filtering options. These will filter the data in a table, but in the current implementation you will still see DDL statements for all tables applied, even if you have filtered out their data. For example, even if you have configured filtering to ignore table `db01.t1`, the `CREATE TABLE` statement for `db01.t1` will still be applied to the replica. diff --git a/packages/dolt/content/reference/sql/server/replication.md b/packages/dolt/content/reference/sql/server/replication.md index 727f2c184..026a898f4 100644 --- a/packages/dolt/content/reference/sql/server/replication.md +++ b/packages/dolt/content/reference/sql/server/replication.md @@ -4,7 +4,7 @@ title: Replication # Replication -Dolt can [replicate data](../../../concepts/dolt/rdbms/replication.md) between two or more Dolt servers, or can be a read-replica for a MySQL server. This page describes the two supported replication modes between a Dolt primary server and Dolt replica servers. See the [MySQL to Dolt Replication guide](../../../guides/binlog-replication.md) for more information on setting up a Dolt server as a read-replica for a MySQL server. +Dolt can [replicate data](../../../concepts/dolt/rdbms/replication.md) between two or more Dolt servers, or between Dolt and a MySQL server. This page describes the two supported replication modes between a Dolt primary server and Dolt replica servers. See the [MySQL to Dolt Replication guide](../../../guides/binlog-replication.md) for more information on setting up a Dolt server as a read-replica for a MySQL server, and [our blog post on Dolt-to-MySQL replication](https://www.dolthub.com/blog/2023-02-17-binlog-replication-preview/) for instructions on running a MySQL server as a replica of a Dolt primary. In **Remote-Based Replication**, Dolt uses a remote as a middleman to facilitate replication between the primary and read replicas. In this mode, Dolt replication triggers on a [Dolt @@ -506,7 +506,7 @@ In the configured example, if you run the first statement on `dolt-1.db` and the second statement on `dolt-2.db`, you will have performed an oderly failover from `dolt-1.db` to make `dolt-2.db` the new primary. -### Atomatic Role Transitions +### Automatic Role Transitions It can happen that server instances learn about new role configuration from their peers as they attempt to replicate writes or when they receive a @@ -728,3 +728,12 @@ If you have an existing MySQL or MariaDB server, you can configure Dolt as a rea consumes data changes from the primary server, it creates Dolt commits, giving you a read-replica with a versioned history of your data changes. See the [MySQL to Dolt Replication guide](../../../guides/binlog-replication.md) for more details on how to configure this. + +# Dolt to MySQL Replication + +If you want to run Dolt as your primary database server, you can still replicate a single branch to a MySQL database. +This is often useful for change data capture (CDC) or data warehouse use cases that require pulling data via +MySQL's replication protocol. +For example, you can [use Debezium to monitor changes in a Dolt database](https://www.dolthub.com/blog/2024-07-19-debezium-works-with-dolt/) for CDC use cases. +See our [blog post on Dolt-to-MySQL replication](https://www.dolthub.com/blog/2023-02-17-binlog-replication-preview/) for +more details on setting up Dolt to MySQL replication.