ApsaraDB RDS provides private and public endpoints for different network scenarios — same-VPC, cross-VPC, on-premises, or internet access. Pick the right endpoint type and configure access control before connecting.
RDS instances run inside an Alibaba Cloud Virtual Private Cloud (VPC). How you connect depends on where your application runs. Selecting the correct endpoint type upfront avoids reworking network rules later.
Connection scenarios
Identify your scenario, then follow the corresponding setup guide.
|
Scenario |
Recommended endpoint |
Notes |
|
Application runs in the same VPC as the RDS instance |
Private endpoint |
Lowest latency; no extra configuration needed if the VPC and subnet already match |
|
Application runs in a different VPC |
Private endpoint (via VPC peering) |
Set up a VPC peering connection first, then use the private endpoint |
|
On-premises application via dedicated connection |
Private endpoint (via Express Connect or VPN Gateway) |
Requires a VPN Gateway or Express Connect circuit between your data center and the VPC |
|
Application connects over the internet |
Public endpoint |
Enable the public endpoint on the instance; restrict access with an IP whitelist |
Enabling a public endpoint exposes your instance to the internet. Always configure an IP whitelist to restrict access to known IP addresses. Disable the public endpoint when it is no longer needed.
Endpoint types
Each RDS instance can have up to two endpoints: one private and one public.
Private endpoint
A private endpoint is created automatically when you create an instance. It is reachable only from within the VPC, a peered network, or a dedicated connection. Use the private endpoint for production workloads — it delivers lower latency and avoids public-network data transfer costs.
Public endpoint
The public endpoint is disabled by default. Enable it only when your application must connect from outside Alibaba Cloud, and add the application's IP addresses to the IP whitelist before testing connectivity.
Network access control
RDS uses two layers of access control:
-
IP whitelist — Controls which IP addresses can reach the instance. Every instance has a default group. Add your application server IPs before the first connection attempt.
-
Security group — An Elastic Compute Service (ECS) security group can be bound to an RDS instance to apply additional inbound rules. Security group rules take effect alongside the IP whitelist.
ImportantEnabling a private endpoint does not automatically disable the public endpoint. If your security requirements prohibit public access, disable the public endpoint explicitly after private connectivity is confirmed.
Authentication methods
RDS supports the following authentication methods. Choose the method that fits your identity infrastructure.
-
Database account and password — The most common method. Create a database account in the RDS console and use the username and password in your connection string.
-
SSL/TLS encryption — Encrypts the connection between your application and the RDS instance. Enable SSL/TLS on the instance, download the CA certificate, and configure your client to verify server identity. This method is compatible with all authentication options listed here.
-
Kerberos authentication — Available for RDS SQL Server instances joined to a Microsoft Active Directory domain. Requires an Active Directory connector configured in the Alibaba Cloud console.
Database proxy and connection pooling
For applications that open many short-lived connections, use the RDS database proxy. The proxy sits between your application and the RDS primary instance, maintains a persistent connection pool, reduces connection overhead, and smooths traffic spikes.
Key behaviors of the proxy instance:
-
Exposes a dedicated proxy endpoint separate from the primary instance endpoint.
-
Supports read/write splitting: write requests go to the primary instance, read requests are distributed to read-only instances.
-
Maintains connections to the RDS instance even when your application disconnects and reconnects frequently.
Related topics
-
Apply for a public endpoint
-
Configure an IP whitelist
-
Set up VPC peering for cross-VPC access
-
Enable SSL/TLS encryption
-
Create and use a database proxy instance