node-firebird
node-firebird copied to clipboard
Performance loss when multiple requests
Hello there,
I'm facing some issue here: I have an endpoint that receives multiples requests from a lot of users. All of it is connected to a unique database.
The point is when a lot of users are send requests at the same time I can see some delay / loss of performance in the requests.
Does this lib can cause this or my issue is another thing?
Hi, do you are using await?
I used, and very slow, I changed and solved.
@FabianoCastro you changed in order to use what?
Like this
returnData(aSQL:string) => { return new Promise<any[]>(async (res, rej) => { aDataBase.query(aSQL, [], async (aError: any, aRows: any[]) => { if (aErroQr) { rej(aErroQr); } else { res(aRows); } });}) }
I can see in exemple too
db.query('INSERT INTO USERS (ID, ALIAS, CREATED) VALUES(?, ?, ?) RETURNING ID', [1, 'Pe'ter', new Date()], function(err, result) { console.log(result[0].id); db.query('SELECT * FROM USERS WHERE Alias=?', ['Peter'], function(err, result) { console.log(result); db.detach(); }); });
https://github.com/hgourvest/node-firebird
I see it...going to try it 😉