For Adobe Commerce sites deployed on cloud infrastructure Pro architecture, Adobe recommends enabling the MYSQL slave connection for the database by default.
Adobe Commerce can read multiple databases asynchronously. When you enable the MYSQL slave connection, Adobe Commerce uses a read-only connection to the database to receive read-only traffic on a non-master node. This improves performance through load balancing, because only one node needs to handle read-write traffic.
Adobe Commerce on cloud infrastructure, Pro architecture
The configuration for the MYSQL slave connection is set by the MYSQL_SLAVE_CONNECTION deploy variable in the Adobe Commerce on cloud infrastructure environment configuration file,
.magento.env.yaml. Set this variable to
true to enable the connection.
To enable the MySQL slave connection:
.magento.env.yaml file and verify that
MYSQL_USE_SLAVE_CONNECTION is enabled.
stage: deploy: MYSQL_USE_SLAVE_CONNECTION: true
Commit any changes, and then push them to the environment branch to deploy the update.
After the deployment completes successfully, the MySQL slave connection is enabled on your cloud infrastructure.
We are aware that this article may still contain industry-standard software terms that some may find racist, sexist, or oppressive and which may make the reader feel hurt, traumatized, or unwelcome. Adobe is working to remove these terms from our code, documentation, and user experiences.