node-postgres
node-postgres copied to clipboard
Do I get any problems when using multiple pg libaries/connection ?
Hello,
When I use the pg libary and I use 10 database connection with pool, do I get any problems or what is the disadvantage ?
exp:
const db1 = new Pool({
host: 'xxx',
user: 'postgres',
database: 'xxx',
password: 'xxx',
ssl: { rejectUnauthorized: false },
port: 54232,
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 10000,
});
const db2 = new Pool({
host: 'xxx',
user: 'postgres',
database: 'xxx',
password: 'xxx',
ssl: { rejectUnauthorized: false },
port: 54232,
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 10000,
});
const db3 = new Pool({
host: 'xxx',
user: 'postgres',
database: 'xxx',
password: 'xxx',
ssl: { rejectUnauthorized: false },
port: 54232,
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 10000,
});
const db4 = new Pool({
host: 'xxx',
user: 'postgres',
database: 'xxx',
password: 'xxx',
ssl: { rejectUnauthorized: false },
port: 54232,
max: 20,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 10000,
});
...
BTW: All databases are different and not the same so all are seperated