I understand how to deploy something like MySQL in a Statefulset, configure replication between the replicas, and how to connect my application to one of the replicas; connect to the primary pod for writes and any pod for reads. Basically, everything in How to Connect Golang application to mysql statefulset in Kubernetes.
So in my application, does that mean I need two connections? One connection for writes and one for reads?
When creating more replicas of my application, how do I manage concurrent connections to the database? Each application pod is connecting to the primary MySQL pod for writes so I sense that there could be data races. Is this something my application has to manage? Or does the database manage it? Or are there proxies designed for this depending on the database?