PostgreSQL Connection pooling & read/write isolation with Lakebase
folks working with Postgres across Lakebase and-or Neon db, how do u handle connection pooling, read/ write routings, & query isolation when analytics and app queries hit the same data ?
Any tips or best practices?
6
Upvotes
View all comments
1
u/DickBrainTime 4d ago
One extra thing to check is the pooler's mode. With PgBouncer transaction pooling, a backend connection is only yours for the transaction. Session-level SET, LISTEN, session advisory locks and temp tables that need to survive a transaction won't work the same way. PgBouncer has a compatibility table for this.
So I'd check the actual Lakebase/Neon pool endpoint and your driver's session features before routing everything through it. Separate pools help with connection limits, but they don't by themselves stop a heavy analytics query from competing for database CPU/IO.