The connection method and code vary with the instance mode. You can connect to cloud-native cluster instances in proxy mode in the same manner as you connect to standard instances and connect to cloud-native cluster instances in direct connection mode in the same manner as you connect to native Redis clusters. If you use a cloud-native cluster instance, you cannot enable the proxy and direct connection modes at the same time or switch between the two modes.
To switch between the two modes, you can use the instance restoration feature on the Backup and Recovery page to restore backup data in an existing cloud-native cluster instance to a new instance. Then, on the Clone Instance page, set Connection Mode to Proxy or Direct Connection. For more information, see Restore data from a backup set to a new instance.
After the new cloud-native cluster instance is created with a new connection mode, modify the connection code accordingly. Otherwise, the instance cannot be connected. Proceed with caution.