If your application is deployed on an Elastic Compute Service (ECS) instance and you need to connect the ECS instance to an ApsaraDB RDS instance, we recommend that you connect the instances over an internal network. This can accelerate access and ensure security.
For more information, see Connect to an ApsaraDB RDS instance.