Quick onboard
Deployment
Data Modeling
Connection
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
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 three mirror distribution strategies in the YMatrix database system: Spread Mirroring, Group Mirroring, and Ring Mirroring.
YMatrix uses Ring Mirroring as the default mirror distribution strategy.
Note!
Mirror replication is strongly recommended for production environments.
When deploying a YMatrix database system, you can configure mirror segments on hosts alongside primary segments.
Functionality:
Best Practice:
| Spread Mirroring | Group Mirroring | Ring Mirroring | |
|---|---|---|---|
| System Stability | Unstable | Stable | Moderately stable |
| Load Balance | Balanced | Unbalanced | Moderately balanced |
Spread Mirroring distributes the mirrors of each host across all other hosts in the cluster. This strategy requires that the number of hosts in the cluster be greater than the number of primary segments per host.
To ensure even distribution, the number of distinct hosts in the array must exceed the number of segment instances per host.

Group Mirroring treats all mirrors of the primaries on a single host as a group and places the entire group on another host in the cluster.

Ring Mirroring works with at least two hosts. It treats the sequence of primary segment IDs on a host as a one-dimensional tape, folds it in half, and then places mirrors starting from the fold point onto other hosts in a clockwise, evenly distributed manner.
When new primaries are added during scale-out, existing mirror rings remain unaffected; instead, a new mirror ring is created.
The figure below depicts a Ring Mirroring configuration for a 3-host cluster with 4 primary segments per host.

Note!
If you wish to use a mirror distribution strategy other than Ring Mirroring in YMatrix, you can implement it via custom configuration using mxaddmirrors.