PmaControl logo PmaControl
  • Home
  • PmaControl
    • AI Agents 13 on-premise agents
    • Plans Community, Cloud, On-Premise, Premium
    • Documentation Guides, API, architecture
    • Clients 28+ companies
    • FAQ 25 questions / 7 categories
    Databases
    • MariaDB 30 articles
    • MySQL 10 articles
    • Galera Cluster 6 articles
    • MaxScale 3 articles
    • ProxySQL 2 articles
    • Amazon Aurora MySQL 0 article
    • Azure Database 0 article
    • ClickHouse 0 article
    • GCP CloudSQL 0 article
    • Percona Server 0 article
    • SingleStore 0 article
    • TiDB 0 article
    • Vitess 0 article
    Solutions
    • Support 24×7 MariaDB & MySQL emergencies
    • Observabilité SQL Monitoring, alerts, topology
    • Haute disponibilité Replication, failover, Galera
    • Disaster Recovery Backup, restore, RPO/RTO
    • Sécurité & conformité Audit, GDPR, SOC2
    • Migration & upgrade Zero downtime, pt-osc, gh-ost
  • Plans
  • Resources
    • Documentation Technical guides & API
    • FAQ 25 frequently asked questions
    • Testimonials Client feedback & use cases
    • Blog Articles & insights
    • Roadmap Upcoming features
    Areas of expertise
    • Observabilité SQL Monitoring, alerts, Dot3 topology
    • Haute disponibilité Replication, failover, Galera
    • Sécurité & conformité Audit, GDPR, SOC2, ISO 27001
    • Disaster Recovery Backup, restore, RPO/RTO
    • Performance & optimisation Digests, EXPLAIN, tuning
    • Migration & upgrade Zero downtime, pt-osc
    Quick links
    • GitHub Wiki 26 pages — install, engine, plugins
    • Source code Official GitHub repository
    • Support 24×7 MariaDB & MySQL emergencies
    • Book a demo 30 min — real architecture
  • Support 24×7
  • Book a demo
Book a demo
🇫🇷 FR Français 🇬🇧 EN English 🇵🇱 PL Polski 🇷🇺 RU Русский 🇨🇳 ZH 中文
← Back to blog

Dot3: Mapping Complex MariaDB / MySQL Topologies

Published on March 21, 2026 By Aurélien LEQUOY
pmacontrol topology graphviz proxysql architecture
Share X LinkedIn Facebook Email PDF
Dot3: Mapping Complex MariaDB / MySQL Topologies

The Problem: Invisible Topologies

You have 40 MariaDB / MySQL instances. Some use Master-Slave replication. Others run Master-Master. A 5-node Galera cluster. Two ProxySQL instances in peer-to-peer. A MaxScale for read routing. SSH tunnels for inter-DC access. DNS aliases masking real IPs.

Simple question: can you draw the complete architecture in under 5 minutes?

In most organizations, the answer is no. The topology lives in an outdated wiki, a Confluence page nobody updates, or in the head of the senior DBA who is on vacation.

Dot3 solves this problem.

What is Dot3?

Dot3 is PmaControl's built-in topology mapping engine. It uses Graphviz (the DOT language) to generate visual representations of database architectures.

The name "Dot3" comes from the third iteration of the engine. The first two versions used simplistic approaches (connection lists, static trees). Dot3 introduces dynamic endpoint resolution and contextual rendering.

Endpoint Resolution

The first step in Dot3 is understanding what hides behind each endpoint configured in PmaControl. An endpoint can be:

1. Direct MariaDB / MySQL Connection

The simplest case. Dot3 connects to port 3306 (or other), runs SHOW VARIABLES and SHOW SLAVE STATUS / SHOW REPLICA STATUS, and identifies the server role (master, slave, standalone).

2. ProxySQL

Dot3 detects ProxySQL by the presence of the admin port (6032 by default). By connecting to the admin port, it retrieves:

  • runtime_mysql_servers: list of backends with their hostgroup
  • runtime_mysql_replication_hostgroups: writer/reader mapping
  • proxysql_servers: ProxySQL peers (for clustering)

This allows tracing the links between ProxySQL and its backends, and between ProxySQL peers.

3. MaxScale

MaxScale is detected via its REST API (port 8989). Dot3 queries /v1/servers and /v1/services to reconstruct the backend topology and routing services.

4. VIPs and Floating Addresses

When an endpoint is a VIP (Virtual IP managed by keepalived or Pacemaker), Dot3 resolves the address to the active physical server. The VIP is represented as an intermediate node with a distinct visual style (diamond instead of rectangle).

5. SSH Tunnels

For multi-DC architectures with SSH tunnels, Dot3 traces the full path: client -> SSH tunnel -> real endpoint. The tunnel appears as a dashed connection in the graph.

6. DNS Aliases

Dot3 resolves DNS aliases (CNAMEs) and displays both the alias name and the real hostname, avoiding confusion when the same server is referenced by multiple names.

Rendering

Once all endpoints are resolved, Dot3 generates a DOT graph that is compiled by Graphviz into SVG (or PNG). Here is how different topologies are represented.

Master-Slave Replication

Master [shape=box, color=blue, label="db-master\n10.0.1.10:3306"]
Slave1 [shape=box, color=green, label="db-slave1\n10.0.1.11:3306"]
Slave2 [shape=box, color=green, label="db-slave2\n10.0.1.12:3306"]
Master -> Slave1 [label="repl"]
Master -> Slave2 [label="repl"]

Replication arrows go from master to slaves (data flow direction). Replication lag is displayed on the edge when significant.

Master-Master Replication

Bidirectional replications are represented with double arrows. Dot3 detects this case when both servers identify each other as master via SHOW SLAVE STATUS.

Master1 -> Master2 [dir=both, label="M-M"]

Galera Cluster

Galera nodes are grouped in a subgraph with a dashed border. Each node is colored according to its wsrep state:

  • Synced: green
  • Donor/Desynced: orange
  • Joining: yellow
  • Disconnected: red
subgraph cluster_galera_prod {
  label="Galera Prod (3 nodes)"
  style=dashed
  galera1 [color=green]
  galera2 [color=green]
  galera3 [color=green]
}

ProxySQL Peer-to-Peer

Links between ProxySQL peers are drawn with bidirectional dashed arrows, visually distinguished from MariaDB / MySQL replication links.

The PNG Icons in SVG Bug

During Dot3 development, we wanted to integrate icons to visually identify node types: a MariaDB icon, a ProxySQL icon, a MaxScale icon.

The first implementation used PNG icons embedded in SVG via <image> tags with base64 href. This worked in browsers but caused several issues:

  1. Graphviz does not correctly support embedded PNGs in its SVG output — positions were offset
  2. Rendering was blurry on Retina/HiDPI screens
  3. SVG file sizes exploded due to base64 encoding

The solution: replace all PNG icons with native SVG icons. We recreated proxysql.svg, maxscale.svg and others in pure vector SVG. The result:

  • Sharp rendering at any resolution
  • Correct positioning in Graphviz
  • File sizes reduced by 5x

Concrete Example

Here is a real (anonymized) topology generated by Dot3 for an e-commerce client:

ProxySQL-1 ←→ ProxySQL-2          (peer-to-peer)
    ↓               ↓
  [HG10: Writer]  [HG20: Readers]
    ↓               ↓
  Master ──→ Slave-1              (replication)
    ↓        Slave-2
    ↓        Slave-3
    ↓
  ┌─────────────────────┐
  │ Galera Cluster       │
  │ Node-1  Node-2      │        (cluster)
  │ Node-3              │
  └─────────────────────┘

This diagram is generated automatically by Dot3. No manual layout configuration. Dot3 discovers the topology, resolves endpoints, and Graphviz handles placement.

Integration in PmaControl

In the PmaControl interface, the topology map is accessible via the Topology tab. It refreshes automatically and reflects real-time state:

  • A slave with replication lag appears with a red edge
  • A Galera node in Donor state changes color
  • A ProxySQL that loses a backend shows it grayed out

The generated SVG is interactive: clicking a node opens the server detail page in PmaControl.

Limitations and Planned Improvements

Dot3 works well for topologies of 1 to 100 nodes. Beyond that, the Graphviz layout can become confusing. Planned improvements include:

  1. Tag filtering: display only a subset of the topology (by environment, client, or DC)
  2. Diff mode: compare two topology snapshots to visualize changes
  3. Terraform export: generate an Infrastructure-as-Code description of the discovered topology

Conclusion

The topology of a MariaDB / MySQL infrastructure does not have to be a mystery documented in an expired wiki. Dot3 discovers it, resolves it, and draws it automatically.

That is the difference between "I think replication goes to that server" and "I see replication goes to that server, with 3 seconds of lag, for the past 14 days".

Share X LinkedIn Facebook Email PDF
← Back to blog

Comments (0)

No comments yet.

Leave a comment

PmaControl
+33 6 63 28 27 47 contact@pmacontrol.com
Legal notice GitHub Contact
Do not wait for an incident to understand your architecture. © 2014-2026 PmaControl — 68Koncept