(Data layer) read and write separation is transparent to the upper layer (logic layer) which is normal logic. Otherwise there will be coupling. I can’t always use my data service
Change the port and follow the code on the business end.
General read-write separation occurs in the form of middleware or plug-ins, which is transparent to the business logic layer (it also thinks that there is only one data service in the background, like a reverse proxy), redis has this form. The master determines which one is reading and which one is writing to uniformly schedule the nodes of the cluster. MySQL's read-write separation or master-slave are all accomplished through plug-ins.
Remember that the separation of reading and writing cannot be reflected in the code of the logic layer (reading operations use the connection of the A service, and writing operations use the connection of the B server).
(Data layer) read and write separation is transparent to the upper layer (logic layer) which is normal logic. Otherwise there will be coupling. I can’t always use my data service
Change the port and follow the code on the business end.
General read-write separation occurs in the form of middleware or plug-ins, which is transparent to the business logic layer (it also thinks that there is only one
Remember that the separation of reading and writing cannot be reflected in the code of the logic layer (reading operations use the connection of the A service, and writing operations use the connection of the B server).data service in the background, like a reverse proxy), redis has this form. The master determines which one is reading and which one is writing to uniformly schedule the nodes of the cluster. MySQL's read-write separation or master-slave are all accomplished through plug-ins.