Distributed SQL with MariaDB Xpand

MariaDB Enterprise Server 10.5 introduces MariaDB Xpand, which provides distributed SQL, high availability, fault tolerance, write scaling, and horizontal scale-out for transactional workloads with MariaDB Enterprise Server. MariaDB Xpand consists of the Xpand storage engine and the MariaDB Xpand service.

Overview

MariaDB Xpand provides distributed SQL with the MariaDB Xpand service and the Xpand storage engine included with MariaDB Enterprise Server 10.5:

  • Xpand supports transactional workloads

  • Xpand is strongly consistent.

  • Xpand leverages a shared-nothing architecture to efficiently execute distributed SQL.

  • Xpand provides high availability (HA) and fault tolerance by design.

  • Xpand scales out horizontally for both reads and writes.

Note

Want to use MariaDB Xpand immediately? Get Started with MariaDB Xpand.

Xpand Architecture

Architecture

Architecture of MariaDB Xpand is designed to provide distributed SQL, high availability, fault tolerance, write scaling, and horizontal scaleout for transactional workloads.

Availability

Xpand stores redundant copies of data on multiple nodes to provide high availability for distributed SQL.

Data Distribution

Xpand stores table and index data separately, and both are split into slices independently. Xpand distributes replicas of these slices through the deployment, ensuring the data remains highly available and fault tolerant.

Fault Tolerance

Xpand provides fault tolerance by maintaining multiple copes of data across the deployment.

Query Evaluation

Data stored on Xpand tables is distributed across all Xpand Nodes in the deployment. When you issue an SQL statement to an Xpand Node, Xpand evaluates the query, optimizes it to form a plan, then retrieves data from slices on relevant Xpand Nodes.

Query Optimizer

Xpand has a sophisticated distributed query planner, compiler, and distributed shared-nothing execution engine.

Rebalancer

The rebalancer process maintains a healthy distribution of data by modifying the placement of data with minimal interruption to user operations and relieving the DBA from the burden of manual data placement.

Strong Consistency

Xpand uses a consistency model that sclaes with a combination of intelligent data distribution, MVCC, and the Paxos Protocol, allowing Xpand to scale writes, scale reads in the presence of write workloads, and provide strong ACID semantics.

Xpand Administration

Administration Tools

How to use Xpand's administration tools.

Allocating Disk Space for Fault Tolerance and Availability

How to allocate disk space that can be used to recover from failures.

Decrease device1 Size

How to shrink device1, which is the primary file used by Xpand.

Deploying MariaDB Xpand

How to install and configure an Xpand deployment.

Email Alerts

How to configure Xpand to send email alerts.

Failure and Recovery

How to recover from various failures.

Fast Backup and Restore

How to backup an Xpand deployment.

Group Changes

How various node changes affect the deployment.

Licensing

How to obtain and apply your license.

Network Security

How to configure your network security.

Replication

How to use MariaDB Replication with Xpand.

Scale-In

How to reduce your deployment's capacy by removing nodes.

Scale-Out

How to increase your deployment's capacity by adding nodes.

Zones

How to configure your deployment to use zones.

Monitoring Xpand

Monitoring Overview

How to monitor Xpand.

Grafana

How to monitor Xpand with Grafana.

Zabbix

How to monitor Xpand with Zabbix.

Term Definitions

Term

Definition

System

One running operating system. A system typically answers one or more IP addresses.

Service

One set of processes running on a system. A service typically answers one or more TCP port or UNIX socket. A service is typically started and stopped using systemd.

Process

One or more pid running on a system, associated with a service. A service may include one or more process. A process typically serves one or more TCP connection or socket connection.

Node

One service, or multiple services working in concert, on a system.

Deployment

One service, or more than one service connected by a multi-node technology. A deployment may operate on one system or multiple. A deployment may contain one node or multiple.

Plugin

A component of MariaDB Enterprise Server which may be included in the server function optionally, either at runtime or compile-time, and which adheres to an established plugin architecture within Enterprise Server.

Multi-Node

The case where multiple nodes exist in a deployment.

MariaDB Enterprise Server service

The MariaDB Enterprise Server service that runs on each node in a deployment.

MariaDB Xpand service

The MariaDB Xpand service that runs on each node in a deployment.

Examples

Creating an Xpand Table

To create an Xpand table, use the CREATE TABLE statement with the ENGINE=Xpand option:

CREATE DATABASE hq_sales;

CREATE TABLE hq_sales.invoices (
   invoice_id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
   branch_id INT NOT NULL,
   customer_id INT,
   invoice_date DATETIME(6),
   invoice_total DECIMAL(13, 2),
   payment_method ENUM('NONE', 'CASH', 'WIRE_TRANSFER', 'CREDIT_CARD', 'GIFT_CARD'),
   PRIMARY KEY(invoice_id)
) ENGINE = Xpand;

SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE
FROM information_schema.TABLES
WHERE TABLE_SCHEMA='hq_sales'
AND TABLE_NAME='invoices';

FAQ

How many nodes should my MariaDB Xpand deployment have?

A MariaDB Xpand deployment should have 3 or more nodes to provide high availability and to avoid a split-brain scenario.

Reference

Xpand Reference

MariaDB Enterprise Server Reference