Free audit

View Audit Scope
MariaDB MaxScaleRead/write split, causal reads & failover

MariaDB MaxScale Proxy Architecture, Tuning & Support

JusDB designs, configures, and supports MariaDB MaxScale database proxies for transparent read/write splitting, causal consistency reads, transaction replay, and automated failover. Database engineers deploy active-passive Keepalived MaxScale pairs, tune mariadbmon and galeramon monitors, and advise on MaxScale 25.01 licensing and ProxySQL alternatives under a 24x7 support agreement.

The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance.

  • NDA before access
  • Read-only by default
  • Written scope before work starts

MaxScale modules & licensing

Select a MaxScale capability

AST-parsed read/write splitting & causal_reads

Router module

Routes DML writes and open transactions to the primary while balancing read-only SELECTs across replicas, using causal_reads=local or fast to prevent stale read-after-write bugs.

Supports master_reconnection=true and delayed_retry so brief blips do not drop client sessions.

See maxscale.cnf configuration specimen

Covers readwritesplit, mariadbmon, galeramon, and MaxScale 25.01 licensing guidance.

Routing & consistency
AST-parsed readwritesplit, causal_reads, transaction_replay, and connection multiplexing
Monitors & security
mariadbmon, galeramon, cooperative_monitoring_locks, and dbfwfilter firewall
Initial-response targets
15 minutes for a critical (P1) routing or failover incident under a 24x7 support agreement. See details

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

When teams call us

MariaDB MaxScale problems we diagnose and fix

We solve stale replica read bugs, ORM session commands that pin 95% of reads to the primary, dual-monitor split-brain promotions, mid-switchover connection drops, and MaxScale 25.01 licensing questions.

Common MariaDB MaxScale symptoms, what is usually happening, and where JusDB engineers start
SymptomWhat is usually happeningWhere we start
Stale replica readsApplication writes a row and immediately reads back old statereadwritesplit sends the subsequent SELECT to an asynchronous replica before the primary's GTID event has finished applying there.Configure causal_reads=local (or fast) with causal_reads_timeout=2s in the readwritesplit service so MaxScale waits for the client's last written GTID on the replica or falls back to the primary.
Session variable pinning95% of SELECT queries still hit the primary instead of replicasORM connection initialization runs SET autocommit, SET sql_mode, or creates temporary tables, which pins the connection to the primary if max_sescmd_history is exceeded.Inspect maxctrl show sessions, enable connection_keepalive, tune max_sescmd_history, and strip unnecessary session-pinning statements from application startup.
Dual-monitor split-brainTwo MaxScale instances promote different replicas during a network blipActive-active MaxScale nodes run mariadbmon with auto_failover=true but without cooperative_monitoring_locks enabled.Set cooperative_monitoring_locks=majority_of_all in mariadbmon so only the MaxScale instance holding the majority backend lock executes failover.
Mid-flight errors on switchoverPlanned maintenance switchovers throw broken pipe errors in the appConnections are terminated abruptly when the primary enters maintenance mode without draining transactions or replaying in-flight queries.Enable master_reconnection=true and transaction_replay=true, and use maxctrl set server <node> maintenance to drain open transactions cleanly before switchover.
Single MaxScale SPOFThe database cluster has 3 nodes, but a single MaxScale VM is a SPOFApplications point to one MaxScale IP address; if that proxy VM reboots, the entire 3-node Galera or GTID cluster becomes unreachable.Deploy two redundant MaxScale nodes across availability zones fronted by a Keepalived VRRP floating VIP or cloud Network Load Balancer, or run MaxScale as an app-local sidecar.
MaxScale 25.01 upgrade blockPackage repo upgrade fails or introduces Enterprise subscription termsMaxScale 25.01+ changed production licensing terms in January 2025, requiring teams on Community Server to review their proxy strategy.Audit your current MaxScale version, evaluate MariaDB Enterprise Server subscription value vs BSL conversion dates, or design an equivalent ProxySQL + Orchestrator stack.

Engineering workflow and response targets

How JusDB deploys and supports MariaDB MaxScale

We design redundant proxy tiers and rehearse switchovers under load. For production topologies covered under a support agreement, Initial-response targets are 2 to 4 hours during covered business hours, Mon–Fri 09:00–18:00 IST (UTC+5:30). Where your service agreement includes 24x7 on-call, the initial-response target for P1 incidents is 15 minutes. Targets are not resolution guarantees.

Four-step MariaDB MaxScale engineering workflow

  1. Audit

    Inspect query mix, ORM session commands, and HA topology

    Check read/write ratios, session-pinning statements, and backend GTID or Galera health.

  2. Configure

    Author maxscale.cnf with causal_reads and replay

    Tune readwritesplit, mariadbmon/galeramon cooperative locks, and Keepalived VRRP VIPs.

  3. Drill

    Test maxctrl switchover and primary crash under load

    Verify transaction_replay behavior and confirm zero stale reads or split-brain promotions.

  4. Monitor

    Wire Prometheus metrics and 24x7 on-call alerts (where contracted)

    Track session counts, routing splits, replica lag thresholds, and monitor lock state.

Published initial-response targets for proxy & failover incidents

  • 2 to 4 hours

    Business hours

    During covered business hours

  • 15 minutes

    24x7 on-call

    P1 incidents

SeverityInitial responseDefinitionChannel & coverage
P1 · Critical15 minutesProduction database down, primary unreachable, data corruption risk, or active failover event.24x7 on-call (under your service agreement) · Direct PagerDuty, Opsgenie, or phone page plus incident bridge
P2 · High30 minutesSevere latency spike, replication lag climbing rapidly, connection exhaustion, or degraded HA node.24x7 on-call (under your service agreement) · On-call alert plus shared Slack or Teams channel
P3 · Medium60 minutesNon-critical slow query regression, staging issue, backup warning, or replication check alert.24x7 on-call (under your service agreement) · Shared Slack or Teams channel or support ticket
P4 · Low90 minutesConfiguration question, index advisory, planned schema review, or general operational request.24x7 on-call (under your service agreement) · Shared Slack or Teams channel or support ticket

Our engineering team is in India; business-hours coverage is Mon–Fri 09:00–18:00 IST (UTC+5:30), and 24x7 on-call is available under your service agreement.

Initial-response targets, not resolution guarantees. The target for your engagement is set in your service agreement.

MaxScale scope

What does MariaDB MaxScale consulting and support cover?

Our scope covers readwritesplit and causal_reads tuning, automated failover with transaction replay, redundant Keepalived proxy HA, database firewall rules, binlog/CDC routing, and licensing advisory.

  • readwritesplit & causal_reads tuning

    Offload read traffic to replicas without breaking read-your-own-writes consistency for your application sessions.

    • Tuning causal_reads (local, fast, global) and causal_reads_timeout
    • Resolving ORM session-command pinning (max_sescmd_history) so reads actually scale

    readwritesplit · causal_reads · max_slave_replication_lag

  • Automated failover & transaction replay

    Make primary promotions and maintenance switchovers invisible to application connection pools.

    • mariadbmon and galeramon configuration with cooperative_monitoring_locks
    • Enabling master_reconnection=true and transaction_replay=true

    mariadbmon · galeramon · transaction_replay · maxctrl

    MariaDB high availability
  • Redundant proxy HA (Keepalived / K8s)

    Eliminate single points of failure in the proxy tier across Linux VMs, cloud networks, and Kubernetes.

    • Active-passive and active-active MaxScale pairs with Keepalived VRRP VIPs
    • Kubernetes MaxScale CRD deployment via mariadb-operator

    Keepalived VRRP · AWS NLB · mariadb-operator MaxScale CRD

    MariaDB on Kubernetes
  • Database firewall, masking & TLS

    Enforce security controls at the wire protocol layer before queries reach your MariaDB storage nodes.

    • dbfwfilter rules to block WHERE-less DELETE/UPDATE or unauthorized DDL
    • Data masking filters for PII columns and end-to-end client/backend TLS

    dbfwfilter · masking filter · ssl_cert · ed25519

    MariaDB security audit
  • Binlog router & Kafka / CDC streaming

    Use MaxScale to offload binary log serving from your primary or stream row events downstream.

    • binlogrouter setup to act as an intermediate binary log relay for many replicas
    • avrorouter and kafkacdc configuration for change data capture pipelines

    binlogrouter · kafkacdc · avrorouter · MariaDB GTID

  • MaxScale 25.01 licensing & ProxySQL advisory

    Objective architectural guidance on MaxScale licensing, BSL versions, and open-source proxy alternatives.

    • Assessment of MaxScale 25.01+ Enterprise subscription requirements
    • Side-by-side design and migration to ProxySQL + Keepalived where preferred

    MaxScale 25.01 · BSL 1.1 · ProxySQL · Prometheus exporter

    MariaDB consulting services

Routing behavior and written evidence

How MaxScale handles causal reads, failover, and node drains

MaxScale parses the wire protocol and SQL AST to track transaction boundaries, GTID causality, and backend maintenance states in real time.

MaxScale readwritesplit and monitor states across three backends

Choose an operational state to see how MaxScale routes queries and manages connections.

Application pool -> MaxScale readwritesplit -> MariaDB backends

MaxScale parses SQL AST, sends writes to db1, and routes reads to db2/db3 using causal_reads=local.

Writes on Primary · Causal reads on Replicas
  • db1 (Master, Running)

    Receives DML writes, DDL, and open transactions

    GTID 0-1-849210 · Primary

  • db2 (Slave, Running)

    Waits < 2ms for GTID 0-1-849210 before serving causal SELECT

    GTID 0-1-849210 · Current

  • db3 (Slave, Running)

    Serves analytical and general read pool traffic

    GTID 0-1-849209 · 0.1s lag

With causal_reads=local, MaxScale attaches a WAIT_FOR_EXECUTED_GTID_SET check to read queries after a session write, preventing stale reads without pinning every SELECT to the primary.

Example production maxscale.cnf and maxctrl runbookSample deliverable

Finding

Offloaded 68% of primary SELECT load to replicas with zero stale read-after-write errors

Previously, the team disabled read/write splitting because asynchronous replica lag caused user profile updates to show stale data on redirect. Enabling causal_reads=local with a 1500ms timeout and transaction_replay=true moved 68% of read queries off the primary without a single stale read.

Primary read offload0% → 68% to replicas
Switchover app errors0 failed txns

1. Production readwritesplit service in /etc/maxscale.cnf

[Read-Write-Service]
type                         = service
router                       = readwritesplit
servers                      = db1,db2,db3
user                         = maxscale_router
password                     = ********
causal_reads                 = local
causal_reads_timeout         = 1500ms
master_reconnection          = true
transaction_replay           = true
transaction_replay_ max_size  = 1Mi
max_slave_replication_lag    = 3s
lazy_connect                 = true

2. Graceful backend drain and switchover via maxctrl CLI

# Inspect live server states, GTID positions, and connections
maxctrl list servers
# Drain a replica cleanly before OS/MariaDB maintenance
maxctrl set server db3 maintenance
# Perform a planned primary switchover with transaction replay
maxctrl call command mariadbmon switchover MariaDB-HA-Monitor db2 db1

Your team and ours

What cloud database services leave to your team on proxy routing

Managed cloud databases automate much of the infrastructure layer, but your team still owns query performance, capacity, cost, and incident decisions.

Who handles each part of running MariaDB MaxScale across cloud services versus your own servers
AreaManaged cloud defaultLinux VMs or Kubernetes with JusDB
Proxy VMs, cloud load balancers, and network security groupsAmazon RDS does not include a managed MariaDB MaxScale tier.Your infrastructure team, sized across AZs with JusDB.
maxscale.cnf routing rules, causal_reads, and session pinningNot included in cloud database services; requires SQL router tuning against your ORM.Configured, tested, and tuned by JusDB engineers.
mariadbmon / galeramon failover and cooperative lockingRDS handles basic single-standby failover; multi-replica GTID or Galera promotion requires MaxScale or Orchestrator.Engineered and rehearsed by JusDB with fenced promotion hooks.
Keepalived VRRP high availability for the proxy tier itselfA single proxy VM creates a new single point of failure unless deployed redundantly.Built by JusDB using active-passive Keepalived VIPs or K8s services.
MaxScale 25.01 licensing compliance and ProxySQL evaluationYour organization owns software license compliance for self-managed proxy binaries.JusDB audits your MaxScale version and designs compliant Enterprise or ProxySQL paths.

Your team keeps control

  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (Terms, section 8)

JusDB handles the agreed MaxScale engineering

  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

Topologies we front with MaxScale

Compare proxies

How MariaDB MaxScale compares with ProxySQL, HAProxy, and RDS Proxy

Compare AST-parsed MaxScale routing and failover against ProxySQL, Layer-4 HAProxy TCP balancing, and cloud-native proxies.

Evaluation VectorJusDB MaxScale DBREMySQL Router / Cloud LBIn-House Generalists
Intelligent Read/Write Splitting & RoutingReadWriteSplit routing with automatic transaction tracking, read-after-write session consistency, and replica lag throttlingStatic port routing or manual application datasource splitting with no transaction-boundary awarenessApplication dual-datasource code prone to reading stale replica state immediately following critical write commits
MariaDB Replication & Galera IntegrationNative MariaDB-Monitor and Galera-Monitor integration with automated master failover, cluster rejoin, and split-brain preventionGeneric TCP proxies unaware of Galera donor states or asynchronous replica replication statusCustom health check scripts failing to detect Galera flow control freezes or MariaDB semi-sync replication stalls
In-Proxy Security & Database FirewallBuilt-in SQL firewall filtering injection patterns, blocking unindexed DELETE/UPDATE queries, and enforcing user permission boundariesBasic network CIDR firewall rules without SQL syntax inspection or query payload validationVulnerable to accidental table-drop scripts or rogue batch queries executing directly against production clusters
Connection Multiplexing & Resource EfficiencyOptimized connection pooling with threadpool integration, reducing backend connection count and the database memory those connections useUnbounded 1:1 client-to-backend thread allocations leading to high context-switch overhead during traffic spikesMicroservices spawning uncontrolled connection pools that saturate MariaDB max_connections thresholds
MaxCtrl CLI & REST Runtime ControlRuntime reconfiguration via maxctrl CLI and REST API; live server swapping and parameter tuning without restartsStatic configuration files requiring service restarts that disconnect active application clientsManual configuration file edits across proxy servers with configuration drift and high operational risk
Monitoring & Incident ResponseContinuous MaxScale REST API metric harvesting into Prometheus, routing latency alerting, and senior DBREs on your incident bridge. Initial-response targets: 2 to 4 hours in covered business hours; 15 minutes for P1 incidents with 24x7 on-call. Targets, not resolution guarantees.Standard vendor ticketing queues with multi-hour turnaround times and lack of hands-on query tuning supportOperations teams struggling to debug MaxScale routing logs and filter configuration errors during critical downtime

For procurement and security

NDA first, read-only by default, and written scope

We work alongside your platform and security teams. Your team approves production switchover windows and keeps every maxscale.cnf manifest, Keepalived script, and drill report.Raguraman, Engineering Manager · Allen D, Lead Database SRE
  • Mutual NDA
  • Written statement of work
  • Named engineers
  • Least-privilege access
  • NDA before access

    Signed before any diagnostic access. The initial scoping call needs no database credentials.

  • Written agreement

    Proxy topology, backend clusters, deliverables, and fees agreed in writing before work starts.

  • Least-privilege accounts

    Dedicated monitor and router grants scoped strictly to required replication and show privileges.

  • Runbooks you keep

    Every maxscale.cnf, Keepalived config, and maxctrl switchover procedure stays with your team. Meet the JusDB team.

JusDB's security practices are aligned with ISO 27001 and SOC 2 Type II, and JusDB is pursuing both certifications (see Terms, section 12). Read the stated status.

FAQ

Common MariaDB MaxScale questions

Answers on causal_reads, MaxScale 25.01 licensing, transaction_replay, Galera writer pinning, and ProxySQL alternatives.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

How does MariaDB MaxScale prevent stale reads when splitting reads and writes?

When causal_reads is enabled on the readwritesplit router (set to local, fast, or global), MaxScale tracks the MariaDB GTID of the last write executed by a client session. When that session issues a subsequent SELECT routed to a replica, MaxScale instructs the replica to wait until it has applied that GTID within causal_reads_timeout, or transparently falls back to the primary.

What changed with MariaDB MaxScale 25.01 licensing?

Under MariaDB plc's licensing update effective 16 January 2025, MaxScale 25.01 and later require a MariaDB Enterprise subscription for production use. Older BSL 1.1 releases convert to GPL after their specified change date. JusDB helps teams either configure licensed MaxScale deployments or migrate to open-source ProxySQL + Orchestrator / Keepalived where preferred.

How does MaxScale transaction_replay work during a primary crash?

When transaction_replay=true and master_reconnection=true are enabled, MaxScale records statement checksums for in-progress transactions. If the primary server drops before COMMIT completes, MaxScale waits for mariadbmon or galeramon to promote the new primary, reconnects the backend session, replays the statements, and verifies that the result set checksums match before returning to the client.

Why should we use MaxScale in front of a MariaDB Galera Cluster?

Writing to multiple Galera nodes simultaneously on hot tables triggers optimistic certification aborts (ERROR 1213). MaxScale's galeramon designates a single primary writer node for all DML while distributing read queries across the remaining synced nodes, and automatically drains or bypasses nodes that enter Donor/Desynced state.

How do you prevent MaxScale itself from becoming a single point of failure?

We never deploy a single standalone MaxScale instance in production. We deploy at least two MaxScale instances across separate availability zones using Keepalived VRRP floating virtual IPs (or cloud Network Load Balancers) and configure cooperative_monitoring_locks=majority_of_all so only one monitor can trigger a failover at a time.

Why are most of our SELECT queries still going to the primary in MaxScale?

In MaxScale readwritesplit, statements that modify session state (such as SET variable commands, temporary tables, or user-defined variables) are replayed on backends up to max_sescmd_history. If an ORM issues too many session commands or leaves autocommit=0 open after a write, the session gets pinned to the primary. We audit maxctrl show sessions and tune both MaxScale and your ORM connection pool.

What are your response targets if MaxScale routing or failover stalls?

Initial-response targets are 2 to 4 hours during covered business hours, Mon–Fri 09:00–18:00 IST (UTC+5:30). Where your service agreement includes 24x7 on-call, the initial-response target for P1 incidents is 15 minutes. Targets are not resolution guarantees. Our engineering team is in India; business-hours coverage is Mon–Fri 09:00–18:00 IST (UTC+5:30), and 24x7 on-call is available under your service agreement.

Should we choose MariaDB MaxScale or ProxySQL?

Choose MariaDB MaxScale when you want native MariaDB GTID causal_reads, transaction_replay, built-in mariadbmon/galeramon failover orchestration, and Kafka/binlog routers in one binary (and hold an appropriate license for 25.01+). Choose ProxySQL when you want a lightweight GPL-licensed proxy with regex/digest query routing, query caching, and multiplexing.

Proxy and HA playbooks

MaxScale, ProxySQL, and Galera Cluster guides

Practical guides from our engineering team on database proxy routing, Galera writer pinning, and high availability.

Next step

Talk to a MariaDB engineer about your MaxScale proxy tier

Tell us your MariaDB topology, read/write ratio, and whether you are evaluating MaxScale or ProxySQL. The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance, subject to availability: mutual NDA before read-only access, a prioritized report within one week after access is ready, and no obligation.

NDA before access · read-only by default · written scope first

Explore all MariaDB services

Need a different MariaDB service? Browse our complete offerings.