ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.28k stars 1.35k forks source link

Master Slave database #1029

Closed mshs013 closed 2 months ago

mshs013 commented 5 months ago

How can I use master-slave database? I want to write data using master DB and read data using slave DB. Anyone can help me to do this?

ThingEngineer commented 2 months ago

What you are looking for is MySQL Replication. The exact implementation method is very dependent on your specific application needs, but this should get you started in the right direction.

Interesting implementation worth diving into considering this is a PHP library. [php-mysql-replication](https://github.com/krowinski/php-mysql-replication)