ColumnStore Read Replicas
Overview
The Read Replicas feature in MariaDB ColumnStore enables horizontal scaling of read performance by incorporating read-only nodes into a multi-node cluster. These replicas differ from standard ColumnStore nodes, in that they don't run the WriteEngineServer process. This means Read Replica nodes cannot handle write operations directly — instead, any write queries attempted on a replica are automatically forwarded to a read-write (RW) node.
Replicas utilize shared storage with other nodes in the cluster, ensuring data consistency without duplication. A key requirement is maintaining at least one RW node — a cluster consisting solely of read replicas is not operational and cannot process reads or writes.
Read-only nodes are incompatible with S3 as the storage backend.
Additionally, there is no automatic promotion of a read replica to RW mode if the only RW node fails, which could lead to temporary downtime until manual intervention.
Key Features
Horizontal Read Scaling: Adds compute power for handling more read-intensive queries without impacting write performance.
Write Forwarding: Ensures writes on replicas are redirected to RW nodes, maintaining data integrity.
Shared Storage: Replicas access the same DBRoots as RW nodes, promoting efficiency and reducing storage overhead.
Key Commands
Add Read Replica. To introduce a read-only node for scaling reads, run this command:
sudo mcs node add --read-replica --node <private-ip>
Remove Node. To safely remove any node (RW or replica) from the cluster, run this command:
sudo mcs node remove --node <private-ip>
This reassigns resources as needed without cluster disruption.
Verify Status. To monitor the cluster's health and node roles, issue:
sudo mcs cluster status
Limitations
Node addition is restricted to private IPs only.
Incompatible with S3 storage, limiting use to shared file systems.
No automatic failover or promotion mechanism if the sole RW node goes down, requiring manual recovery.
At least one RW node must always be present for the cluster to function properly, supporting both read and write operations.
How-To
Prerequisites
Refer to shared storage setup for exact mount points details.
Installation and Setup
Set Up MariaDB Repository
Run the following to add the MariaDB repository (adjust "11.4" to the latest stable version):
wget https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup ;
chmod +x mariadb_es_repo_setup;
./mariadb_es_repo_setup --token="xxxxx" --apply --mariadb-server-version="11.4"
See this page for additional details about the ES repo setup.
Install Packages
For RPM-based systems, run this command:
sudo dnf install -y \
MariaDB-server MariaDB-columnstore-engine MariaDB-columnstore-cmapi
Refer to this blog post for additional information.
For DEB-based systems, run these commands:
sudo apt update
sudo apt install -y mariadb-server mariadb-plugin-columnstore mariadb-columnstore-cmapi
Configure MaxScale
See this page for instructions.
Last updated
Was this helpful?