we are moving our prototype service to production environment. I dont find any best library/way to do mysql read replication in golang sql library.
Our Mysql database services running on AWS RDS (one master and stwo slaves).
Need to do the following.
- insert/update/delete should go to master
- read from any database (including master also fine)
currently we have only one database connection.
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
db, err := sql.Open("mysql", "root:password@tcp(localhost:3306)/test")
How can we make our db instance to work with read replicas in golang ? Thanks.