Skip to content

docs: add comprehensive topology/provider/proxy reference (#71)#74

Merged
renecannao merged 1 commit intomasterfrom
worktree-agent-aae77db6
Apr 3, 2026
Merged

docs: add comprehensive topology/provider/proxy reference (#71)#74
renecannao merged 1 commit intomasterfrom
worktree-agent-aae77db6

Conversation

@renecannao
Copy link
Copy Markdown

@renecannao renecannao commented Apr 3, 2026

Summary

New reference page covering all topologies, providers, proxies, and their differences in one place.

Sections:

  1. Provider × Topology matrix — what works where
  2. Proxy layer differences — ProxySQL vs MySQL Router (config, failover, R/W split, ports)
  3. MySQL sandbox users — all users, roles, passwords
  4. ProxySQL user configuration — monitor, R/W, R/O users
  5. Replication mechanism differences — MySQL standard vs GR vs InnoDB Cluster vs PostgreSQL
  6. Port allocation — ranges for each provider/topology
  7. Sandbox directory structures — layout for each topology
  8. Available scripts per topology — what scripts exist where
  9. Command quick reference — deploy commands for every topology

Added to website sidebar under Reference > Topology Reference.

Closes #71

Test Plan

  • Website builds (41 pages)
  • Sidebar entry renders

Summary by CodeRabbit

  • Documentation
    • Added a new "Topology Reference" documentation page providing comprehensive reference material for dbdeployer configurations, including provider and topology support matrices for MySQL and PostgreSQL variants, proxy-layer comparisons between ProxySQL and MySQL Router, replication mechanism details, deterministic port allocation rules, sandbox directory structures across topology types, available helper scripts per topology, and command examples for deployment scenarios.

Copilot AI review requested due to automatic review settings April 3, 2026 06:55
@renecannao renecannao merged commit 472d760 into master Apr 3, 2026
9 of 26 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e7d3a273-169d-430a-8eb9-28e843210eb2

📥 Commits

Reviewing files that changed from the base of the PR and between 2c6eba9 and 29cae3e.

📒 Files selected for processing (2)
  • website/astro.config.mjs
  • website/src/content/docs/reference/topology-reference.md

📝 Walkthrough

Walkthrough

This PR extends the documentation site by adding a new "Topology Reference" navigation item and comprehensive reference page. The new documentation consolidates information about dbdeployer's supported database providers, topologies, proxy layers, configuration matrices, directory structures, and helper scripts.

Changes

Cohort / File(s) Summary
Navigation Configuration
website/astro.config.mjs
Added "Topology Reference" sidebar link to the Reference section of the Starlight documentation configuration.
Documentation Content
website/src/content/docs/reference/topology-reference.md
New comprehensive reference page documenting provider × topology support matrices (MySQL/PostgreSQL), proxy layer differences (ProxySQL vs MySQL Router), default sandbox users, replication mechanisms, deterministic port allocation rules, sandbox directory structures across topology types, helper scripts availability matrix, and example deployment commands.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Hops of joy through topology lands,
A reference map now in reviewers' hands,
From proxies to ports, each sandbox design,
The docs now complete—what a grand design!
No more confusion, just clarity bright,
dbdeployer's paths made perfectly right! 🎉

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-agent-aae77db6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive 'Topology Reference' documentation page for dbdeployer, covering provider-topology matrices, proxy layer differences, user management, and directory structures. The review feedback highlights several technical inaccuracies in the new documentation, specifically regarding ProxySQL's compatibility with single topologies, the mathematical formula for MySQL port derivation, and the specific directory naming conventions used for PostgreSQL sandboxes.

| Failover (replication) | Static hostgroups | Not supported (Router does not handle standard replication) |
| Failover (GR / InnoDB Cluster) | `mysql_group_replication_hostgroups` | Metadata-aware, fully automatic |
| Read/write split | Query rules + hostgroups | Port-based: dedicated R/W port vs R/O port |
| Compatible topologies | replication, group, innodb-cluster | innodb-cluster only |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

ProxySQL is also compatible with the single topology, as implemented in the deploy single command (see cmd/single.go). It should be included in the list of compatible topologies.

Suggested change
| Compatible topologies | replication, group, innodb-cluster | innodb-cluster only |
| Compatible topologies | single, replication, group, innodb-cluster | innodb-cluster only |


| Provider / Topology | Base port formula | Ports per instance | Example |
|---------------------|------------------|--------------------|---------|
| MySQL single | Version-derived (e.g. `major×1000 + minor×10`) | 3 (main + admin + mysqlx) | 8.4.8 → 8408 |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The formula for the MySQL base port is incorrect. Based on the example 8.4.8 → 8408, the calculation is major * 1000 + minor * 100 + revision. The current text incorrectly states minor * 10.

Suggested change
| MySQL single | Version-derived (e.g. `major×1000 + minor×10`) | 3 (main + admin + mysqlx) | 8.4.8 → 8408 |
| MySQL single | Version-derived (e.g. major×1000 + minor×100 + revision) | 3 (main + admin + mysqlx) | 8.4.8 → 8408 |

### PostgreSQL single sandbox

```
~/sandboxes/pgsb_16_13/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The directory name for PostgreSQL single sandboxes in the documentation (pgsb_16_13) does not match the implementation in cmd/single.go. The code uses the format postgresql_sandbox_{port} (e.g., postgresql_sandbox_16613).

Suggested change
~/sandboxes/pgsb_16_13/
~/sandboxes/postgresql_sandbox_16613/

### PostgreSQL replication sandbox

```
~/sandboxes/pgrsandbox_16_13/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The directory name for PostgreSQL replication sandboxes in the documentation (pgrsandbox_16_13) does not match the implementation in cmd/replication.go. The code uses the format postgresql_repl_{port} (e.g., postgresql_repl_16613).

Suggested change
~/sandboxes/pgrsandbox_16_13/
~/sandboxes/postgresql_repl_16613/

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Topology Reference” documentation page intended to centralize provider/topology/proxy/user/ports/scripts/directory-layout information, and links it from the website sidebar under Reference.

Changes:

  • Added a comprehensive topology/provider/proxy reference page.
  • Added a new sidebar entry pointing to the new reference page.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 14 comments.

File Description
website/src/content/docs/reference/topology-reference.md New reference page covering supported topologies/providers plus proxy/users/ports/scripts/directory layouts and command examples.
website/astro.config.mjs Adds “Topology Reference” to the Reference section of the docs sidebar.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| InnoDB Cluster | 21000 (default) | varies by node count | nodes at 21001, 21002, 21003 |
| MySQL Router | Assigned at bootstrap | 4 (R/W, R/O, X R/W, X R/O) | 6446 / 6447 / 6448 / 6449 |

Port conflicts are automatically avoided: dbdeployer checks whether a port is in use before deploying and bumps the base if needed. Use `dbdeployer deploy single <version> --check-port` to preview the port that will be used.
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--check-port is referenced here, but there is no such CLI flag (no matches in cmd/ or elsewhere). Since dbdeployer does do port bumping via FindFreePort, consider either removing the preview suggestion or pointing to an existing command/documentation for inspecting computed ports.

Suggested change
Port conflicts are automatically avoided: dbdeployer checks whether a port is in use before deploying and bumps the base if needed. Use `dbdeployer deploy single <version> --check-port` to preview the port that will be used.
Port conflicts are automatically avoided: dbdeployer checks whether a port is in use before deploying and bumps the base if needed.

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +82
| `mysql_monitor_username` | `rsandbox` | Health checks (requires `REPLICATION CLIENT`) |
| `mysql_monitor_password` | `rsandbox` | Corresponding password |
| `mysql_users`: `msandbox` | `default_hostgroup=0` | General proxy connections routed to the writer group |
| `mysql_users`: `msandbox_rw` | `default_hostgroup=0` | Explicit write connections |
| `mysql_users`: `msandbox_ro` | `default_hostgroup=1` | Read connections routed to the reader group |
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This table implies ProxySQL uses rsandbox as monitor user and that multiple application users are configured in mysql_users. In the current ProxySQL deployment flow, monitor_user defaults to msandbox and the generated mysql_users/pgsql_users block contains only that one user (see sandbox/proxysql_topology.go and providers/proxysql/config.go). Please update these rows to match current behavior (or adjust the implementation if the intent is to preconfigure RW/RO users).

Suggested change
| `mysql_monitor_username` | `rsandbox` | Health checks (requires `REPLICATION CLIENT`) |
| `mysql_monitor_password` | `rsandbox` | Corresponding password |
| `mysql_users`: `msandbox` | `default_hostgroup=0` | General proxy connections routed to the writer group |
| `mysql_users`: `msandbox_rw` | `default_hostgroup=0` | Explicit write connections |
| `mysql_users`: `msandbox_ro` | `default_hostgroup=1` | Read connections routed to the reader group |
| `mysql_monitor_username` | `msandbox` | Health checks using the default monitor user configured by dbdeployer |
| `mysql_monitor_password` | `msandbox` | Corresponding password |
| `mysql_users`: `msandbox` | `default_hostgroup=0` | Only preconfigured ProxySQL frontend user; connections default to the writer hostgroup |

Copilot uses AI. Check for mistakes.
### PostgreSQL single sandbox

```
~/sandboxes/pgsb_16_13/
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostgreSQL single sandbox directory naming here (pgsb_16_13) doesn’t match the implementation. dbdeployer deploy postgresql 16.13 creates ~/sandboxes/pg_sandbox_<port>/ (e.g., pg_sandbox_16613). Please update this example path to the real one.

Suggested change
~/sandboxes/pgsb_16_13/
~/sandboxes/pg_sandbox_16613/

Copilot uses AI. Check for mistakes.
Comment on lines +282 to +284
├── use_admin # Admin interface (port 6032)
├── use # Proxy interface (port 6033)
├── proxysql.cfg # Initial bootstrap config
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ProxySQL overlay tree doesn’t match what the ProxySQL provider generates: the config file is proxysql.cnf and the scripts are use (admin) + use_proxy (proxy), not use_admin + use and not proxysql.cfg (see providers/proxysql/proxysql.go). Please align the filenames/script names here.

Suggested change
├── use_admin # Admin interface (port 6032)
├── use # Proxy interface (port 6033)
├── proxysql.cfg # Initial bootstrap config
├── use # Admin interface (port 6032)
├── use_proxy # Proxy interface (port 6033)
├── proxysql.cnf # Initial bootstrap config

Copilot uses AI. Check for mistakes.
Comment on lines +248 to +255
~/sandboxes/pgrsandbox_16_13/
├── start_all
├── stop_all
├── status_all
├── use_all
├── check_replicas # Show replication lag / state
├── metadata
├── master/
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostgreSQL replication topology directory naming/layout here (pgrsandbox_16_13/ with master/) doesn’t match the implementation. The code uses ~/sandboxes/postgresql_repl_<port>/primary/replicaN (see cmd/replication.go). Please update this example path and the node directory names accordingly.

Suggested change
~/sandboxes/pgrsandbox_16_13/
├── start_all
├── stop_all
├── status_all
├── use_all
├── check_replicas # Show replication lag / state
├── metadata
├── master/
~/sandboxes/postgresql_repl_<port>/
├── start_all
├── stop_all
├── status_all
├── use_all
├── check_replicas # Show replication lag / state
├── metadata
├── primary/

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +79
| `mysql_monitor_username` | `rsandbox` | Health checks (requires `REPLICATION CLIENT`) |
| `mysql_monitor_password` | `rsandbox` | Corresponding password |
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section documents ProxySQL config variables as mysql_monitor_username/mysql_monitor_password, but the generated proxysql.cnf uses monitor_username/monitor_password inside mysql_variables (or pgsql_variables) (see providers/proxysql/config.go). Please align the docs with the actual variable names.

Suggested change
| `mysql_monitor_username` | `rsandbox` | Health checks (requires `REPLICATION CLIENT`) |
| `mysql_monitor_password` | `rsandbox` | Corresponding password |
| `monitor_username` | `rsandbox` | Health checks (requires `REPLICATION CLIENT`) |
| `monitor_password` | `rsandbox` | Corresponding password |

Copilot uses AI. Check for mistakes.

| Provider / Topology | Base port formula | Ports per instance | Example |
|---------------------|------------------|--------------------|---------|
| MySQL single | Version-derived (e.g. `major×1000 + minor×10`) | 3 (main + admin + mysqlx) | 8.4.8 → 8408 |
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MySQL port formula shown (major×1000 + minor×10) doesn’t match how dbdeployer computes ports. For MySQL, common.VersionToPort() formats major, minor, and a zero-padded 2-digit rev (e.g., 8.4.8 → 8408). Please correct the formula text to match the implementation.

Suggested change
| MySQL single | Version-derived (e.g. `major×1000 + minor×10`) | 3 (main + admin + mysqlx) | 8.4.8 → 8408 |
| MySQL single | Version-derived (formatted as `major`, `minor`, and zero-padded 2-digit `rev`) | 3 (main + admin + mysqlx) | 8.4.8 → 8408 |

Copilot uses AI. Check for mistakes.
Comment on lines +336 to +339
dbdeployer deploy replication 8.4.8 --topology=group

# Group Replication, multi-primary mode
dbdeployer deploy replication 8.4.8 --topology=group --single-primary=false
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples label --topology=group as “single-primary mode”, but single-primary is controlled by the boolean --single-primary flag; without it, group replication deploys multi-primary (group_msb_...). Please adjust the example commands so the described mode matches the flags used.

Suggested change
dbdeployer deploy replication 8.4.8 --topology=group
# Group Replication, multi-primary mode
dbdeployer deploy replication 8.4.8 --topology=group --single-primary=false
dbdeployer deploy replication 8.4.8 --topology=group --single-primary
# Group Replication, multi-primary mode
dbdeployer deploy replication 8.4.8 --topology=group

Copilot uses AI. Check for mistakes.
dbdeployer deploy replication 16.13 --provider=postgresql

# Streaming replication with ProxySQL
dbdeployer deploy replication 16.13 --provider=postgresql --proxy=proxysql
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These PostgreSQL examples also use --proxy=proxysql, but the supported flag is --with-proxysql. Please update this command line so it’s copy/paste correct.

Suggested change
dbdeployer deploy replication 16.13 --provider=postgresql --proxy=proxysql
dbdeployer deploy replication 16.13 --provider=postgresql --with-proxysql

Copilot uses AI. Check for mistakes.
Comment on lines +216 to +218
├── router/ # MySQL Router instance
│ ├── start
│ ├── stop
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The InnoDB Cluster example shows router/start and router/stop, but dbdeployer generates router_start/router_stop scripts at the topology root, and Router bootstrap creates router/start.sh (see sandbox/innodb_cluster.go). Please update this directory listing to match the real script names.

Suggested change
├── router/ # MySQL Router instance
│ ├── start
│ ├── stop
├── router_start
├── router_stop
├── router/ # MySQL Router instance
│ ├── start.sh

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: comprehensive documentation covering all topologies, providers, proxies, and their differences

2 participants