MariaDB MaxScale Documentation

repository·24.02·Indexed 23 days ago

https://github.com/mariadb-corporation/maxscale

Documentation for MariaDB MaxScale, an intelligent database proxy providing load balancing, high availability, and protocol-aware routing. Includes guides for generating REST API documentation, configuring the MaxGui development environment, and integrating the mxs-workspace UI component for Vue.js 2 and webpack 4.

Tokens
190K
Snippets
457
Records
1K
Agent score
81%

What's inside MariaDB MaxScale

  1. What is MariaDB MaxScale

    24.02
    MariaDB MaxScale is an intelligent database proxy designed to provide load balancing and high availability transparently to applications. It uses semantic understanding of database statements and backend cluster roles to forward statements to one or more database servers based on complex rules. The architecture is highly scalable and flexible, utilizing plugin components to support various protocols and routing decisions.
  2. What is MaxCtrl and how to connect to it

    24.02

    MaxCtrl is the command-line administrative client for MaxScale. It communicates with MaxScale via the MaxScale REST API.

    By default, the REST API listens on port 8989 on localhost. The default credentials for the REST API are admin:mariadb. The users used by the REST API are identical to those used by the MaxAdmin network interface; any users created for MaxAdmin will work with MaxCtrl.

  3. Understand the maxscale-system-test architecture

    24.02

    The maxscale-system-test suite consists of system-level tests where every individual test is implemented as a separate executable file.

    Configuration for backends (such as IP addresses, usernames, and passwords) is provided via environment variables rather than static configuration files. This allows the test runner to inject dynamic connection details into the test executables.

  4. Navigate MaxGUI pages and features

    24.02

    MaxGUI provides several views for managing MaxScale via a browser-based interface:

    • Dashboard: Provides an overview of Monitors, Servers, Services, Sessions, Listeners, and Filters. The default refresh interval is 10 seconds.
    • Detail: View and edit parameters, relationships, and perform manipulation operations on specific MaxScale objects. Access this by clicking an object name on the Dashboard.
    • Visualization:
      • Configuration: Visualizes the MaxScale configuration.
      • Cluster: Visualizes replication clusters as a tree graph. Supports manual operations like switchover, reset-replication, release-locks, failover, and rejoin for servers monitored by the mariadbmon module. Access via the graph icon in the sidebar.
    • Settings: Edit MaxScale parameters. Access via the gear icon in the sidebar.
    • Logs Archive: Access real-time MaxScale logs via the logs icon in the sidebar.
    • Workspace: A toolset for data and database management. Access via the sidebar.
  5. Manage MaxScale filter resources via REST API

    24.02

    A filter resource in MaxScale represents a specific filter instance. Filters are modular components that can be shared across multiple services, and a single service can utilize multiple filters.

    Key Constraints:

    • Naming: In all URIs, :name or :filter must be the exact name of the filter in MaxScale.
    • Relationships: Filters only have relationships with services. Because the filter-to-service relationship is ordered (filters are applied in the order they are listed in the service configuration), you cannot define these relationships when creating a filter. You must manage the service $\rightarrow$ filter relationship via the services resource instead.
    • Deletion: A filter can only be destroyed if no service is currently using it (i.e., its data.relationships object is empty). To bypass this, use the force=yes parameter.
  6. What is Avrorouter

    24.02

    Avrorouter is a MariaDB 10.0 binary log to Avro file converter. It consumes binary logs from a local directory and transforms them into Avro files, which can then be queried by clients.

    It can be used in two ways:

    1. In tandem with Binlog Server: The Binlog Server connects to a primary server and requests binlog records, which the avrorouter consumes directly from the Binlog Server's binlog cache. This allows MaxScale to automatically transform binlog events on the primary into local Avro format files.
    2. Directly from the primary: The avrorouter consumes binary logs straight from the primary server. This removes the need for a Binlog Server but increases the disk space requirement on the primary server by at least a factor of two.

    Clients communicate with the avrorouter using the CDC protocol, which is currently the only supported protocol. Clients can request data streams in either Avro or JSON format from a database table.

  7. What is SmartRouter and how does it enable HTAP?

    24.02

    SmartRouter is the query router for the SmartQuery framework. It enables Hybrid Transactional and Analytical Processing (HTAP) by providing a single entry point for mixed workloads.

    SmartRouter automatically routes queries to the most appropriate cluster based on the query type:

    • Transactional (OLTP) queries are routed to the primary/master cluster.
    • Analytical (OLAP) queries are routed to optimized analytical clusters (e.g., ColumnStore).

    This allows a client to execute both transactional and analytical queries over the same connection without manually switching between different service endpoints.

  8. What is the Top N Filter?

    24.02

    The Top N Filter is a MariaDB MaxScale filter module that monitors SQL statements passing through it. It measures the duration of each statement (the time from when the statement is sent until the first result is returned) and tracks the top $N$ slowest queries.

    Upon the closure of a client session, the filter writes a report to a file containing the SQL text and a list of the slowest queries sorted by execution time.

  9. Overview of the Readwritesplit router

    24.02

    The readwritesplit router increases the read-only processing capability of a cluster by splitting query loads into read and write queries.

    • Write queries: All write queries are routed to a single node (the primary).
    • Read queries: Read queries (those that do not modify data) are spread across multiple nodes.

    Use Cases:

    • Primary-Replica clusters: Automatically detects changes in the primary server and routes writes to the current primary.
    • Galera clusters: Can be used for resilient setups by designating one Galera node as the Write-Primary for all write queries, while spreading the read load across all nodes in the cluster.