From 1d5877e28b866cc4ef038fced7c91a4389b25679 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Wed, 6 Sep 2023 14:49:04 +0300 Subject: [PATCH 1/2] Document read replication and transaction behaviour --- docs/other-topics/read-replication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/other-topics/read-replication.md b/docs/other-topics/read-replication.md index 303f1c591..4125f4548 100644 --- a/docs/other-topics/read-replication.md +++ b/docs/other-topics/read-replication.md @@ -28,4 +28,4 @@ Sequelize uses a pool to manage connections to your replicas. Internally Sequeli If you want to modify these, you can pass pool as an options when instantiating Sequelize, as shown above. -Each `write` or `useMaster: true` query will use write pool. For `SELECT` read pool will be used. Read replica are switched using a basic round robin scheduling. +Each `write` or `useMaster: true` query will use write pool. For `SELECT` read pool will be used. When all reads and writes when using transactions will be sent to the write pool by default. Read replica are switched using a basic round robin scheduling. From 802c2689055a9ccf1dd378ca15d0a11cf41e5cba Mon Sep 17 00:00:00 2001 From: Risto the Chef Date: Wed, 3 Jun 2026 02:55:00 +0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/other-topics/read-replication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/other-topics/read-replication.md b/docs/other-topics/read-replication.md index fd3c9556e..1751fb168 100644 --- a/docs/other-topics/read-replication.md +++ b/docs/other-topics/read-replication.md @@ -49,4 +49,4 @@ Sequelize uses a pool to manage connections to your replicas. Internally Sequeli If you want to modify these, you can pass pool as an options when instantiating Sequelize, as shown above. -Each `write` or `useMaster: true` query will use write pool. For `SELECT` read pool will be used. When all reads and writes when using transactions will be sent to the write pool by default. Read replica are switched using a basic round robin scheduling. +Each `write` or `useMaster: true` query will use the write pool. `SELECT` queries will use the read pool by default. Within a transaction, all queries use the same connection, so with replication enabled they are sent to the write pool by default. Read replicas are switched using a basic round robin scheduling.