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.
Key uses of MaxScale include:
Load balancing for database scale-out
Automated failover for High Availability (HA)
Query and data routing for Hybrid Transactional/Analytical Processing (HTAP)
Implementation of security and traffic controls for database connections and queries
MariaDB MaxScale allows application clients to connect as they would to a single database, while abstracting the complexity of the underlying database infrastructure. MaxScale can provide transparent proxying, failover, load balancing, read/write splitting, and security controls without adjustment to client configuration.
Architectural features include:
Maintenance of connection, session, and transaction state on behalf of applications.
Causal reads (consistent read-your-writes behavior when using read/write splitting).
Adaptive load balancing to optimize the routing of traffic to the fastest database instance based on actual Server load conditions.
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 provides support for replication between row-based and columnar storage engines, ensuring that transactional updates to data replicate to columnar tables for analytical processing.
MaxScale monitors server availability and can trigger automated failover for service resiliency:
In MariaDB Replication topologies, MaxScale 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.
In MariaDB Enterprise Cluster topologies, where any Cluster node may execute reads or writes, MaxScale 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 to remove write conflicts.
MaxScale includes several configurable features to minimize the impact of failover on client connections:
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.
MaxScale provides a point of IT and data control implementation. Features include:
SQL 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.
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.
Encryption and decryption provides secure connections between MaxScale and applications and between itself and the database. 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.
What's New in MaxScale 2.4?¶
Administrative user passwords now stored as SHA2-512 hashes
Smart query routing
CDC data adapter
Server can be drained
Servers can be explicitly grouped into primary and secondary groups
Unix domain socket for servers
Connection attempt throttling
Avrorouter Direct Replication
Query Classifier Cache can be examined
What's New in MaxScale 2.3?¶
Query Classifier Cache added
Transaction replay in read/write split router