MariaDB MaxScale
Topics on This Page:
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 Enterprise 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:
Transparent database proxy for MariaDB Replication deployments
Automated failover to provide high availability (HA) for MariaDB replication deployments
Transparent database proxy for Galera Cluster deployments
Transparent database proxy for Multi-Node Enterprise ColumnStore deployments
Query and data routing for Hybrid Transactional/Analytical Processing (HTAP) deployments
Built-in mechanisms to perform server maintenance without disruption to applications or clients
Caching the results of SELECT statements to improve performance
Implementation of security and traffic controls for database connections and queries
MariaDB Replication Solutions
MariaDB Monitor (mariadbmon) provides advanced solutions for MariaDB replication deployments:
Automatic failover when the primary server fails.
Cooperative locking to coordinate multiple highly available MaxScale instances.
Query-Based Load Balancing
Read/Write Split Router (readwritesplit) provides query-based load balancing with advanced features:
Query-based routing, so that replica servers can be properly utilized.
Automatic primary server re-connection in case of server failure.
Automatic transaction replay in case of server failure or deadlock.
Maintenance of connection state on behalf of applications.
Causal reads to ensure consistent read-your-writes behavior.
Adaptive query-based load balancing to optimize the routing of traffic to the fastest database instance based on actual server load conditions.
Retries of failed reads to ensure that the client is not affected by server failures.
Delayed retries of failed queries to ensure that the client is not affected by temporary cluster failures.
Connection-Based Load Balancing
Read Connection Router (readconnroute) provides connection-based load balancing:
Replication |
Description |
---|---|
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. |
|
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. |
|
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. |
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 |
---|---|
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. |
|
MaxScale's Galera Monitor (galeramon) is used to minimize application impact upon server failure. Additionally, MaxScale can 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. |
|
MaxScale's MariaDB Monitor (mariadbmon) determines which node is the primary server, and if the primary server fails, MaxScale automatically performs failover using the CMAPI (Cluster Management API) commands. |
MaxScale's Read/Write Split Router (readwritesplit) includes several configurable features to minimize the impact of failover on client connections:
Feature |
Description |
---|---|
Replaces back-end server connections to a failed server with connections to a different server, rather than closing the connections. |
|
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. |
|
Ensures all servers handling traffic for a connection have the same session system variables, user-defined variables, etc. |
|
Allows MaxScale to route incomplete queries to a different replica rather than returning an error or closing the client connection. |
|
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 |
---|---|
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. |
|
Obfuscates the return values of specified columns, so that sensitive data will not be leaked. |
|
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. |
|
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. |
|
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. |
|
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:
MaxCtrl allows operations to be performed on the command-line.
MaxGUI allows operations to be performed in a graphical interface.
Both tools use MaxScale's built-in REST API.
All tools support data-in-transit encryption.
Check out what's new in MariaDB MaxScale.