Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
25 replies
Lopen

should i use a pool or connection in mysql

This is my first time going raw on sql. i usually use an orm(prisma)

So, in this application; it's an express application
I am using
mysql2
package to do my queries

This application is read intensive, possibly like hundreds or more read per second

Should i use a
mysql.createConnetion
or
mysql.createPool


Also, note that i will inject the connection into express

app.use((req,res,next)=>
{
req.db = Dbconnection
})


Also, do i need to await the db? Because it's going to create more complexity
Was this page helpful?