Set up optional database replication
Setting up database replication provides the following benefits:
- Provides data backup
- Enables data analysis without affecting the master database
- Scalability
MySQL databases replicate asynchronously, which means slaves do not need to be connected permanently to receive updates from the master.
Configure database replication
An in-depth discussion of database replication is beyond the scope of this guide. To set it up, you can consult a resource like:
Magento provides sample MySQL configurations for your slave databases. A simple configuration is provided with the ResourceConnections
class README.md
.
The following is more advanced and is provided for your information only:
Performance improvement
To improve the performance of master-slave replication, you can filter some tables on slave instances. We recommend filtering all temporary tables with name pattern search\_tmp\_%
that are used for catalog search.
To do this, add the following line to your my.cnf
file on your slave instances:
replicate-wild-ignore-table=%.search\_tmp\_%
For more information about this setting, see MySQL documentation.