MariaDB MaxScale

MariaDB MaxScale is an advanced database proxy, firewall, and query router.

MaxScale is a component of MariaDB Platform. MaxScale is compatible with MariaDB Enterprise Server, MariaDB ColumnStore, and MariaDB Community Server.

Architectural Solutions

MariaDB MaxScale allows applications and clients to connect as they would to a single database, while abstracting the complexity of the underlying database infrastructure. Key architectural solutions supported by MaxScale include:

MariaDB Replication Solutions

MariaDB Monitor (mariadbmon) provides advanced solutions for MariaDB replication deployments:

Query-Based Load Balancing

Read/Write Split Router (readwritesplit) provides query-based load balancing with advanced features:

Connection-Based Load Balancing

Read Connection Router (readconnroute) provides connection-based load balancing:

Replication

Description

MariaDB Replication

When used with MaxScale's MariaDB Monitor (mariadbmon), Read Connection Router (readconnroute) can be configured to route connections to the primary server, a replica server, or any running server.

Galera Cluster

When used with MaxScale's Galera Monitor (galeramon), Read Connection Router (readconnroute) can be configured to route connections to the primary server, a replica server, any synced server, or any running server.

Multi-Node ColumnStore

When used with MaxScale's ColumnStore Monitor (csmon), Read Connection Router (readconnroute) can be configured to route connections to the primary server, a replica server, or any running server.

Read Caching

The Cache Filter (cache) caches the results of SELECT statements:

  • Improving performance in some cases.

  • Multiple storage types are supported, including:

    • Fast, in-memory storage.

    • Memcached storage for deployments with multiple MaxScale instances that need to share a cache.

    • Redis storage for deployments with multiple MaxScale instances that need to share a cache.

Hybrid Transactional/Analytical Processing (HTAP)

Hybrid Transactional/Analytical Processing (HTAP) allows applications to combine the benefits of row-based transactional databases with columnar analytical databases through a single interface.

MariaDB MaxScale is a central component of HTAP:

  • MaxScale provides transparent dynamic routing of transactional queries to Servers configured for Online Transactional Processing (OLTP) and analytical queries to Servers configured for Online Analytical Processing (OLAP).

  • MaxScale uses MariaDB Replication and the Binlog Filter (binlogfilter) to replicate between row-based and columnar storage engines, ensuring that updates to transactional data are replicated to columnar tables for analytical processing.

Automatic Failover

MaxScale's automatic failover capabilities depend on the specific replication solution that is used.:

Replication

Description

MariaDB Replication

MaxScale's MariaDB Monitor (mariadbmon) detects primary server failure and promotes the most up-to-date replica based on Global Transaction ID (GTID), waits for that replica to execute any transactions in its relay log, and begins routing queries to it.

Galera Cluster

MaxScale's Galera Monitor (galeramon) is used to minimize application impact upon server failure. Additionally, MaxScale may be used to assign primary and replica roles to database instances within a cluster to support read/write traffic splitting and to minimize the risk of certification failures.

Multi-Node ColumnStore

MaxScale's ColumnStore Monitor (csmon) determines which node is the primary server, and automatically adapts upon primary server failure.

MaxScale's Read/Write Split Router (readwritesplit) includes several configurable features to minimize the impact of failover on client connections:

Feature

Description

Automatic Reconnection

Replaces back-end server connections to a failed server with connections to a different server, rather than closing the connections.

Transaction Replay

Ensures the execution of prior transactions before additional queries are routed to different Servers, instead of closing the connection and requiring the application to roll the transaction back and retry.

Connection Maintenance and Restore

Ensures all servers handling traffic for a connection have the same session system variables, user-defined variables, etc.

Read Retry

Allows MaxScale to route incomplete queries to a different replica rather than returning an error or closing the client connection.

Delayed Retry

Allows MaxScale to delay and retry write queries received after a primary fails and before automatic failover completes, rather than returning an error or closing the client connection.

Traffic Controls

MaxScale provides a point of IT and data control implementation. Features include:

Feature

Description

Database Firewall

Restricts data access and blocks by rejecting or accepting queries based on a combination of syntax, type, time, and user. Rules are customizable and it supports both whitelisting and blacklisting queries. Rejected queries can be logged to provide insight into suspicious activity.

Column Masking

Obfuscates the return values of specified columns, so that sensiutive data will not be leaked.

Query throttling

Can be used to set a threshold on the maximum number of queries per second allowed and to close an application session if it exceeds the defined threshold. Short bursts within a defined window can be allowed.

Result limiting

Limits the number of results a query can return to prevent accidental or malicious queries from rendering the database unavailable or exposing large amounts of data.

Data-in-Transit Encryption

Encrypts data in transit using TLS. MaxScale can encrypt the connection between itself and the application, and it can also encrypt the connection between itself and the back-end database servers. MaxScale can decrypt client traffic for inspection and logging before it is sent to the database server.

Authentication support

Supports PAM and GSSAPI (for example, Kerberos) for authentication

Proxy Protocol support

The proxy protocol allows proxy programs to relay the IP of the clients to the server programs. MariaDB server understands both Version 1 (text) and Version 2 (binary) of the proxy header.

Kafka CDC Router

MaxScale provides a Kafka CDC Router (kafkacdc). Features include:

  • Replicating data from MariaDB to a Kafka broker.

  • Streaming MariaDB data to external databases that can act as Kafka consumers or connectors, such as Elasticsearch and MongoDB.

Flexible Tools and Interfaces

MaxScale provides flexible tools to make operations easy:

Check out what's new in MariaDB MaxScale.