A transparent database agent
The database connected to Java is Sharding-Proxy, an independent application. Instead of connecting directly to mysql
After modifying two YAML configuration files (yamL, server.ymal for library and table rules)
“CMD” is used to connect to shardingProxy (the connection is exactly the same as connecting to mysql directly). Show bases can see that there is only one Sharding schema, which means that the mysql server we see now is a server disguised as Shard.
Subsequent queries and new operations are first brokered and then distributed to each table in each library according to the configuration file sharding.
Config-master-slave. yaml One master and two slave
Configure read/write separation (can split libraries, not just mysql) for demonstration purposes. You can find that the master is not used in the query operation
Primary/secondary replication in mysql configuration