How to choose between upgrading and scaling out
PolarDB-X provides two approaches to scaling your cluster: upgrading node specifications and adding nodes. Upgrading specifications is fast and requires no data migration, making it suitable for handling sudden traffic spikes. Adding nodes increases overall capacity but requires data migration, making it better suited for planned, long-term growth.
How it works
Upgrade node specifications
Upgrading node specifications increases the CPU, memory, and IOPS of existing nodes without changing the total node count. It also includes expanding storage capacity.
Upgrades are performed in-place on the host where the node runs. For example, to change a node from 4 cores to 8 cores, PolarDB-X checks whether the host has enough idle CPU. If it does, the upgrade completes in-place — no data migration is required. In-place upgrades are fast, especially for data nodes.
If the host does not have enough resources, the node migrates to a different host, which takes longer.
Nodes with low specifications can typically be upgraded in-place. Downgrades are also performed in-place.
Add nodes
Adding nodes scales out the cluster by adding compute nodes or data nodes while keeping existing node specifications unchanged.
When you add nodes, PolarDB-X rebalances data across all nodes, which requires data migration. Migration time is proportional to the amount of data involved.
Adding or removing nodes triggers data migration. Plan the operation during a maintenance window when business impact is acceptable, and allow enough time for migration to complete before the next traffic peak.
When to use each approach
| Situation | Recommended approach | Reason |
|---|---|---|
| Traffic spike or peak hours | Upgrade node specifications | Fast to apply; no data migration required |
| Off-peak hours after a spike | Downgrade node specifications | Reduces cost; done in-place |
| Planned capacity increase for daily operations and maintenance (O&M) | Add nodes | Each node stays at lower specifications; burst traffic can still be handled by an in-place upgrade if needed |
| Disk space is running low | Increase disk capacity or add nodes | Increasing disk capacity is an online operation with no impact on services. Adding nodes triggers data rebalancing. If only storage expansion is needed without additional compute resources, increasing disk capacity is recommended. |
Upgrading node specifications does not increase disk capacity. If storage is the bottleneck, you can increase disk capacity (online expansion with no service impact) or add nodes (triggers data rebalancing).
Metrics to monitor
For online transaction workloads, keep data loads below 30% of the threshold per day. This provides headroom to absorb burst traffic from promotional events or service code issues. Adjust this threshold based on your traffic patterns.
Compute node metrics
-
CPU utilization
-
Number of active threads
-
Response time (RT): logical RT and physical RT
Data node metrics
-
CPU utilization
-
IOPS usage
-
Number of active sessions
Storage threshold
Add nodes before disk space runs out. Scale out when occupied disk space exceeds 70% of total disk capacity. If you only need to increase disk capacity without adding nodes, you can expand storage space online through the upgrade operation.
Procedure
After determining the scaling approach, refer to the following documents for step-by-step instructions:
-
Upgrade specifications (upgrade CN/DN node specifications, expand storage space): See Change instance specifications.
-
Add or remove CN/DN nodes: See Add or remove nodes.
-
Set a maintenance window (perform specification changes during a fixed time period): See Set a maintenance window.