Quick Start
Simulate Time Series Scenarios
Standard Cluster Deployment
Data Modeling
Connecting to The database
Data Writing
Data Migration
Data Query
Maintenance and Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool Guide
Data Type
Storage Engine
Execution Engine
Configuration Parameters
SQL Reference
FAQ
This document describes the mirror distribution strategy in the YMatrix database system.
When deploying the YMatrix database system, mirror segments (Mirror) can be configured on hosts.
Note!
Mirror is strongly recommended in production environments.
Before discussing YMatrix's mirror distribution strategy, we first introduce Greenplum’s mirror strategies as background. Greenplum supports two standard mirror configurations: Group Mirroring and Spread Mirroring. Group Mirroring is the default.
In Spread Mirroring, mirrors from each host are distributed across the remaining hosts in the cluster. This configuration requires that the number of hosts in the cluster exceeds the number of primary segments per host.
To ensure even distribution, the number of independent hosts in the array must be greater than the number of segment instances per host.
_1689234437.png)
In Group Mirroring, all mirrors for primary segments on a single host are grouped together and placed on another host in the cluster.
This is the default mirror distribution strategy in Greenplum.
_1689234443.png)
YMatrix uses Ring Mirroring as the default strategy. With at least two hosts, the primary segment sequence on one host is treated as a one-dimensional tape, folded in the middle. Starting from the middle sequence number on the other host, mirrors are placed clockwise and evenly distributed across the remaining hosts.
When expanding the cluster by adding new primaries, the existing mirror ring remains unchanged, and a new mirror ring is created.
This is the default mirror distribution strategy in YMatrix.
_1689234430.png)
This strategy balances the advantages and disadvantages of the two Greenplum strategies, offering a compromise. The comparison among the three strategies is shown in the table below:
| Spread | Group | Ring | |
|---|---|---|---|
| System Stability | Unstable | Stable | Moderately Stable |
| Load Balance | Balanced | Unbalanced | Moderately Balanced |
Note!
If you want to use a mirror distribution strategy other than Ring in YMatrix, you can achieve this through custom configuration using mxaddmirrors.