Quick onboard
Deployment
Data Modeling
Connecting
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool guide
Data type
Storage Engine
Executor
Stream
DR (Disaster Recovery)
Configuration
Index
Extension
SQL Reference
This document describes the mirror distribution strategies used in the YMatrix database system.
When deploying a YMatrix database system, mirror segments (Mirror) can be configured on hosts.
Note!
Enabling mirroring is strongly recommended in production environments.
Before discussing YMatrix's mirror distribution strategy, this section provides background knowledge based on Greenplum’s mirror configurations. Greenplum supports two standard mirroring configurations: Group Mirroring and Spread Mirroring, with Group Mirroring being 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 total number of independent hosts 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 within 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 half. Starting from the middle segment ID after folding, mirrors are placed clockwise and evenly distributed across other hosts.
When expanding the cluster by adding new primaries, the existing mirrored ring remains unchanged; instead, a new mirror ring is initiated.
This is the default mirror distribution strategy in YMatrix.
_1689234430.png)
This strategy balances the advantages and disadvantages of the previous two methods, offering a compromise between them. The comparison among the three strategies is shown in the table below:
| Spread | Group | Ring | |
|---|---|---|---|
| System Stability | Unstable | Stable | Moderately Stable |
| Load Balancing | Balanced | Unbalanced | Moderately Balanced |
Note!
If you wish to use a mirror distribution strategy other than Ring Mirroring in YMatrix, you can achieve this through custom configuration using mxaddmirrors.