Hacker News new | ask | show | jobs
by fauigerzigerk 2424 days ago
It sounds like this would limit scalability quite a bit because you'd either have to keep a DB connection open for each active user or close connections rather aggressively.
2 comments

PostgREST performs authorization at transaction level, not at connection or session level, so a connection can be used by thousands of active users simultaneously.
Oh that's very interesting indeed! I thought each open connection remained linked to exactly one authenticated user account until it is closed.
The row level security is a feature of the database (postgresql), those rules are written and enforced by the database, they have nothing to do with PostgREST and how it connects to the database
I am aware of that but I thought that this approach would effectively prevent sharing pooled connections between different users. But taffer says otherwise, so that solves the problem I was wondering about.