If your database system receives a large number of read requests, you can create one or more read-only ApsaraDB RDS for SQL Server instances to increase the read capability of your database system and the throughput of your application. ApsaraDB RDS for SQL Server uses the Always On architecture of native SQL Server. In ApsaraDB RDS for SQL Server, physical replication is implemented to replicate a primary RDS instance and generate a read-only RDS instance. The data on the read-only RDS instance is the same as the data on the primary RDS instance. If the data on the primary RDS instance is updated, the updates are automatically synchronized to the read-only RDS instance.
For more information about the features, limits, and scenarios of read-only RDS instances, see Overview of read-only ApsaraDB RDS for SQL Server instances.
ApsaraDB RDS for SQL Server supports fast initialization of read-only RDS instances when their primary RDS instance meet specific requirements. This shortens the creation time of read-only RDS instances to minutes and does not affect the I/O performance of their primary RDS instance. For more information, see Appendix: Introduction to fast initialization of read-only RDS instances.
Prerequisites
A primary RDS instance that meets the following requirements is created:
The primary RDS instance runs SQL Server 2017 EE on RDS Cluster Edition, SQL Server 2019 EE on RDS Cluster Edition, or SQL Server 2022 EE on RDS Cluster Edition.
The primary RDS instance runs RDS Cluster Edition.
The primary RDS instance uses Enterprise SSDs (ESSDs) or general ESSDs.
The RDS instance uses the subscription or pay-as-you-go billing method. Serverless RDS instances do not support the creation of read-only RDS instances.
Before you create a read-only RDS instance for a primary RDS instance, you need to check the major engine version or RDS edition of the primary RDS instance on the Basic Information page of the primary RDS instance.
If you want to create a read-only RDS instance for the primary RDS instance that runs RDS Basic Edition or RDS High-availability Edition, you need to upgrade the primary RDS instance to SQL Server EE (Always On) and then create a read-only RDS instance. For more information, see Upgrade the major version.
Usage notes
You can create read-only RDS instances for a primary RDS instance. You cannot convert existing primary RDS instances to read-only RDS instances.
When you create a read-only RDS instance, the system replicates data from the secondary RDS instance to the read-only RDS instance. This prevents interruptions to your workloads on the primary RDS instance.
Number of read-only RDS instances: You can create up to seven read-only RDS instances for a primary RDS instance.
Instance backup: You cannot configure backup policies or manually create backups for read-only RDS instances. These are configured and created on the primary RDS instance. You cannot create temporary RDS instances from backup files or any point in time. You cannot overwrite RDS instances by using backup sets. After a read-only RDS instance is created, you cannot use backup sets to overwrite the primary RDS instance to restore data.
Data migration: You cannot migrate data to read-only RDS instances.
Database management: You cannot create or delete databases on read-only RDS instances.
Account management: You cannot create or delete accounts, grant permissions to accounts, or change the passwords of accounts on read-only RDS instances.
The period of time that is required to create a read-only RDS instance is positively correlated with the data volume and the I/O performance of the primary RDS instance. Before you create a read-only RDS instance, we recommend that you evaluate and optimize the data volume and I/O performance of the primary RDS instance to shorten the creation time.
The storage capacity of a read-only RDS instance cannot be less than the storage capacity of the primary RDS instance. For more information about the storage capacity range of a read-only RDS instance, see Read-only ApsaraDB RDS for SQL Server instance types.
Billing rules
You are charged for the read-only RDS instances that you create based on the subscription billing method or the pay-as-you-go billing method. For more information, see Pricing.
If the billing method of the primary RDS instance is serverless, you cannot create read-only RDS instances.
Create a read-only RDS instance
- Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
In the Instance Distribution section of the page that appears, click add to the right of Read-only Instance.
Configure basic information, including the billing method, storage type, and zone. Then, click Next: Instance Configuration.
Configure the Billing Method parameter.
Billing method
Description
Benefit
Subscription
A subscription instance is an instance for which you pay an upfront fee. If you want to use an instance for a long period of time, we recommend that you select the Subscription billing method. If you select the subscription billing method, configure the Subscription Duration parameter in the lower part of the page.
For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are offered lower prices for longer subscription durations.
Pay-as-you-go
You are charged on an hourly basis for a pay-as-you-go instance based on your actual resource usage. If you want to use an instance for a short period of time, we recommend that you select the Pay-as-you-go billing method.
You can create a pay-as-you-go RDS instance. After you confirm that the created RDS instance meets your business requirements, you can change the billing method of the RDS instance to subscription.
You can release a pay-as-you-go RDS instance at any time. The billing of a pay-as-you-go RDS instance stops immediately after you release the instance.
Configure the Storage Type parameter.
For more information, see Storage types.
Configure the Zone parameter.
NoteEach zone is an independent physical location within a region. No substantive differences exist between zones in the same region.
If the RDS instance resides in the same zone as the Elastic Compute Service (ECS) instance on which your application is deployed, these instances can deliver optimal performance. If the RDS instance and the ECS instance reside in different zones in the same region, the performance of the RDS instance and the ECS instance is slightly lower than the performance of the RDS instance and the ECS instance that reside in the same zone.
Configure the Instance Type parameter.
Specify the category (dedicated or general-purpose instance family). Then, specify the CPU cores, memory capacity, and maximum number of connections.
Instance type
Description
Benefit
General-purpose Instance Types
A general-purpose RDS instance occupies all the allocated memory and I/O resources.
A general-purpose RDS instance shares CPU and storage resources with the other general-purpose RDS instances that are deployed on the same host.
General-purpose instances are cost-effective.
Dedicated Instance Types
A dedicated RDS instance occupies all the allocated CPU, memory, storage, and I/O resources.
NoteThe dedicated host instance family is the highest configuration of the dedicated instance family. A dedicated host RDS instance exclusively occupies all the CPU, memory, storage, and I/O resources of the host on which the RDS instance is deployed.
A dedicated instance provides better performance and stability.
NoteSelect the instance type to which you want to upgrade. Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Instance types for read-only ApsaraDB RDS for SQL Server instances.
To ensure I/O performance for data synchronization, we recommend that you make sure that the memory capacity of the read-only RDS instance is higher than or equal to the memory capacity of the primary RDS instance.
Configure the Storage Capacity parameter.
The storage capacity of the RDS instance. The storage capacity is used to store data files, system files, archived log files, and transaction files. The valid values of the Storage Capacity parameter vary based on the values of the Storage Type and Instance Type parameters that you specify. You can adjust the storage capacity at a step size of 5 GB.
NoteThe storage capacity of a read-only RDS instance cannot be less than the storage capacity of the primary RDS instance.
If you select the local SSD storage type, the storage capacity of the RDS instance may vary based on the instance type. If you select the standard SSD or ESSD storage type, the storage capacity of the RDS instance does not vary based on the instance type. For more information, see Primary ApsaraDB RDS instance types.
Configure instance resources, such as the network type, vSwitch, and resource group. Then, click Next: Confirm Order.
The Network Type parameter is fixed as VPC.
Configure the VPC and vSwitch of Primary Node parameters.
We recommend that you select the VPC in which your ECS instance resides for the RDS instance. If the RDS instance and the ECS instance reside in different VPCs, these instances cannot communicate over an internal network.
NoteYou can connect the RDS instance and the ECS instance over an internal network even if the instances use different vSwitches in the same VPC.
Configure custom parameters. If you do not have special business requirements, you can retain the default values of these parameters.
Parameter
Description
Release Protection
If you set Billing Method to Pay-as-you-go, you can enable Release Protection to prevent accidental release of the instance. For more information, see Enable or disable the release protection feature.
Resource Group
You can use the default resource group or select a custom resource group based on your business requirements.
Instance Description
The value must be 2 to 255 characters in length and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter.
Change the character set collation rule of system databases
The character set collation rule of the primary RDS instance is automatically used.
Confirm the configuration of the RDS instance in the Parameter Configuration section, configure the Quantity and Subscription Duration parameters, read and select Terms of Service, and then click Pay Now to complete the payment. You must configure the Subscription Duration parameter only if you select the subscription billing method for the RDS instance.
NoteIf you select the subscription billing method for the RDS instance, we recommend that you select Auto-renewal. This way, you can prevent interruptions on your workloads even if you forget to renew the RDS instance.
It requires 1 to 10 minutes to create a serverless RDS instance. You can refresh the page to view the serverless RDS instance.
View a read-only RDS instance
You can view a read-only RDS instance on the Instances page, the Cluster Management page of the required RDS instance, or the Basic Information page of the required RDS instance.
View a read-only RDS instance on the Instances page
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region in which the read-only RDS instance resides.
Find the read-only RDS instance and click the ID of the instance.
View a read-only RDS instance on the Basic Information page
You can view a read-only RDS instance on the Basic Information page of the primary RDS instance.
Log on to the ApsaraDB RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where the primary RDS instance resides.
Find the primary RDS instance and click the ID of the instance.
On the Basic Information page of the primary RDS instance, move the pointer over the number of read-only RDS instances and click the ID of the read-only RDS instance that you want to view.
View a read-only RDS instance on the Cluster Management page
Prerequisites
The read/write splitting feature is enabled on the Cluster Management page of the primary RDS instance to which the read-only RDS instance is attached. For more information, see Enable read/write splitting.
Procedure
Log on to the ApsaraDB RDS console.
Find the primary RDS instance and click the ID of the instance.
In the left-side navigation pane, click Cluster Management.
Find the read-only RDS instance and click the ID of the instance.
References
You can call the CreateReadOnlyDBInstance operation to create a read-only RDS instance. For more information, see CreateReadOnlyDBInstance.
After a read-only RDS instance is created, you must enable read/write splitting and configure the read weights of your read-only RDS instances. The system processes read requests based on the configured weight ratio. For more information, see Enable read/write splitting by enabling the read-only routing endpoint.