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

Possibility of bringing back "allow_prepend_tenant_name" for PostgreSQL? #200

Open
jordan-brough opened this issue Apr 22, 2022 · 0 comments

Comments

@jordan-brough
Copy link

jordan-brough commented Apr 22, 2022

We'd like to use apartment in conjunction with postgres schemas and AWS RDS Proxy.

However, it looks like the RDS Proxy docs say that statements like set search_path cause "pinning" and eliminate a lot of the benefits of RDS Proxy:

Avoiding pinning

Multiplexing is more efficient when database requests don't rely on state information from previous requests. ... Examples of such state information include most variables and configuration parameters that you can change through SET or SELECT statements. ...

Your connections to the proxy can enter a state known as pinning. When a connection is pinned, each later transaction uses the same underlying database connection until the session ends. Other client connections also can't reuse that database connection until the session ends. ...

RDS Proxy automatically pins a client connection to a specific DB connection when it detects a session state change that isn't appropriate for other sessions. Pinning reduces the effectiveness of connection reuse. If all or almost all of your connections experience pinning, consider modifying your application code or workload to reduce the conditions that cause the pinning.

https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy-managing.html#rds-proxy-pinning

So if I understand that correctly, I believe that using apartment with Postgres schemas would mean that all connections would be pinned.

Would bringing back the old allow_prepend_tenant_name option fix this? I see it was removed in #40, but @rpbaltazar mentioned:

I still think that using this prepend_tenant seems like a good idea but I'll need further testing and investigation on how to make it safe.

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

1 participant