PolarDB for PostgreSQL (Compatible with Oracle) allows you to create multi-zone clusters. PolarDB provides multiple deployment solutions: dual-zone (hot standby storage cluster enabled) deployment and dual-zone (hot standby storage cluster and compute cluster enabled) deployment. You can select a deployment solution based on your business scenario.
Multi-zone deployment
If you use multi-zone deployment, data is distributed in multiple zones. The primary zone and the secondary zone individually contain three replicas of data. This way, a total of six replicas of data are saved, which ensures high SLA reliability. Compute nodes must be deployed in the primary zone. The hot standby storage cluster and compute nodes in the secondary zone are mainly deployed for a failover when the primary zone fails. For more information, see Switch the primary zone
The following figure shows the architecture of the deployment solutions.
To use multi-zone deployment, the following requirements must be met:
The region in which you want to deploy the multi-zone cluster contains at least two zones.
The secondary zone has sufficient computing resources.
If you want to use the dual-zone (hot standby storage cluster and compute cluster enabled) deployment, contact us.
High-availability mode
Overview
Single-zone (hot standby storage cluster disabled)
Database services are only provided by the cluster in the primary zone. This solution is less costly.
However, it takes longer time to recover services in case the primary zone fails. If you require cross-zone high availability, we recommend that you use the multi-zone deployment.
Switching rules
It can be switched to dual-zone (hot standby storage cluster enabled) or dual-zone (hot standby storage cluster and compute cluster enabled).
Scenarios
Small-sized websites and applications
You can offload routine O&M tasks to Alibaba Cloud and focus on developing your applications.
Individuals
If you are new to PolarDB, you can use PolarDB for testing and learning.
Development and testing
PolarDB features lightning-fast provision, allowing you to flexibly scale your database with your business requirements. This significantly improves R&D and testing efficiency.
Dual-zone (hot standby storage cluster enabled)
Data is distributed in multiple zones. The primary zone and secondary zone each store a copy of full data, which ensures high service level agreement (SLA).
Compute nodes must be deployed in the primary zone. The hot standby storage cluster in the secondary zone is mainly deployed for a failover when the primary zone fails.
Switching rules
It can only be switched to single-zone (hot standby storage cluster disabled).
Billing for specifications change
Data is distributed in multiple zones. The primary zone and a secondary zone individually contain three replicas of data. This way, a total of six replicas of data are saved. Its storage costs are higher than those of single-zone (hot standby storage cluster disabled).
Scenarios
It is suitable for more than 80% of use cases in various industries, such as Internet, IoT, online retailing, logistics, and gaming.
Dual-zone (hot standby storage cluster and compute node enabled)
Data is distributed in multiple zones. The primary zone and secondary zone each store a copy of full data, which ensures high service level agreement (SLA).
Hot standby storage clusters and compute clusters in the secondary zone are used for failovers when the primary zone fails. The hot standby compute node in the secondary zone can be read. After a failover, the hot standby compute node can be promoted to the primary node.
Switching rules
It can only be switched to single-zone (hot standby storage cluster disabled).
Billing rules
Compute nodes
When you purchase a cluster, hot standby compute nodes are added to the secondary zone in which the hot standby storage cluster resides. By default, the specifications of hot standby compute nodes in the secondary zone are the same as those in the primary zone. The hot standby compute nodes in the secondary zone are separately charged.
Storage space
Data is distributed in multiple zones. The primary zone and a secondary zone individually contain three replicas of data. This way, a total of six replicas of data are saved. Its storage costs are higher than those of single-zone (hot standby storage cluster disabled).
Scenarios
It is suitable for large-sized enterprises and medium-sized enterprises whose production databases need to process a large number of read requests during peak hours or perform intelligent data analysis. These enterprises include financial institutions, online retailers, automobile enterprises, education enterprises, and Enterprise Resource Planning (ERP) service providers.
For more information about billing rules for compute nodes and storage, see Billing.
Enable or switch to the high-availability mode
When you purchase a cluster, you can select the high-availability mode in the Network and Zone section.
NoteThe high-availability mode option is limited by the zones and resources available in the region where the cluster is deployed. For more information, see the buy page.
Go to the
. On the Clusters page, click the cluster. In the Database Distributed Storage section of the Basic Information page, click Switch to HA Mode.
View the zones of a cluster
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner of the page, select the region in which the cluster resides and click the ID of the cluster to go to the Basic Information page.
On the Overview page, view the Zones section.
Change the primary zone
You can change the primary zone of a PolarDB cluster if you use the multi-zone deployment. This feature allows you to migrate the compute nodes of a cluster to a different zone. This feature is suitable for scenarios such as disaster recovery or when an Elastic Compute Service (ECS) instance needs to access the cluster in a nearby zone.
For a PolarDB for PostgreSQL (Compatible with Oracle) cluster for which hot standby is enabled, you cannot change the primary zone after you enable tiered storage for cold data for the cluster. To change the primary zone in such cases, contact us.
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner of the page, select the region in which the cluster resides and click the ID of the cluster to go to the Basic Information page.
On the Basic Information page of the cluster, click Change Primary Zone.
In the dialog box that appears, configure the Destination Zone and Destination vSwitch parameters, and then configure the Effective Time parameter based on your business requirements.
NoteIf the destination zone is a secondary zone, data migration is not required. The system migrates only the compute nodes. The average time required to migrate a node across data centers is 5 minutes. In most cases, the operation is performed during disaster recovery drills.
If the destination zone is not a secondary zone, data must be migrated. The time required to migrate data varies based on the amount of data. If the amount of data is excessively large, the operation may require several hours to complete. Proceed with caution. In most cases, this operation is performed to adjust the distribution of applications and databases among zones for applications to access databases from the nearest zone.
In the message that appears, click OK.
ImportantAfter the primary zone is changed, the primary endpoint and the cluster endpoints of the cluster remain unchanged. However, the vSwitch and IP address may be changed. This operation may disrupt your database service for less than 60 seconds. Proceed with caution.
Create a read-only endpoint for the hot standby compute node
You can create a read-only endpoint for the hot standby compute node when the high-availability mode is set to dual-zone (hot standby storage cluster and compute node enabled). If you want to use the dual-zone (hot standby storage cluster and compute cluster enabled) deployment, contact us.
The read-only endpoint for the hot standby compute node must be a private endpoint.
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. In the upper-left corner of the page, select the region in which the cluster resides and click the ID of the cluster to go to the Basic Information page.
In the Database Connections section, click Create Read-only Node Endpoint. In the message that appears, click OK. Then, you can use this endpoint to access the hot standby compute node.