Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should I keep using Pool rather than Client with RDS Proxy #3293

Open
oriarazi opened this issue Aug 13, 2024 · 1 comment
Open

Should I keep using Pool rather than Client with RDS Proxy #3293

oriarazi opened this issue Aug 13, 2024 · 1 comment

Comments

@oriarazi
Copy link

Hello,
I have a question about the best practice when connecting RDS Proxy. (TL;DR Should I use Pg.Pool or Pg.Client ?)

Let's say I am querying the database multiple times, sometimes concurrently(multiply SELECT statements).

I know RDS Proxy has its pooling, but does it mean we do not need pooling to the Proxy itself at the application level?

Thanks!

@MRterrorOP
Copy link

i think you should use Pg.pool becuase Pg.client is use for single transaction. let suppose you are managing a bank transaction so in that case you have to use Pg.client because you have to mutate two data without failing mean (if one SELECT statement fail then both SELECT statement should fail). if amount is deduct from a user then it have to add in another user. but if you concern about making SELECT statements mulitple time and your target is that even if a SELECT statement doesn't get executed then it doesn't effect other SELECT statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants