Does it make sense to increase performance using multiple connections to the same database?

Will I have the option
db, err := sql.Open("mysql", "root:password@/productdb")

// many threads pinging the db queries.Query

a similar performance this option:
db, err := sql.Open("mysql", "root:password@/productdb")
db1, err := sql.Open("mysql", "root:password@/productdb")

// many threads, half of which pull requests db, the second half db1
March 29th 20 at 23:24
2 answers
March 29th 20 at 23:26
Solution
No, there is already a connection pooling is used.

You can specify the number of waiting (IDLE) connections db.SetMaxIdleConns and the maximum number of simultaneously open connections via db.SetMaxOpenConns
March 29th 20 at 23:28
Does it make sense to increase performance using multiple connections to the same database?
DBMS is usually the slowest link. Even so, the overwhelming number of architectural solutions DBMS the slowest link.
The second case is not only not the most productive but not the most secure. It is an appeal to two different databases, db and db1. So there is a problem of data synchronization between databases, and then one can start to give some data and the other other on the same query. Data synchronization process is not always quick. And while data is not synchronized, will have to wait for a response. Otherwise you'll come out of the split brain.

Find more questions by tags Go