Database / Supabase Intermediate to Advanced Interview Questions
How does Supabase's connection string differ between the direct connection, session pooler, and transaction pooler?
All three ultimately reach the same Postgres database, but they differ in what sits between the client and Postgres, and in what connection-level features survive that path.
| Direct Connection | Session Pooler | Transaction Pooler |
| One dedicated Postgres connection per client | Pooled, held for the client's whole session | Pooled, checked out per transaction only |
| Supports prepared statements, LISTEN/NOTIFY | Supports most session-level features | Cannot reliably support prepared statements |
| Best for long-lived backend servers | Good general-purpose default | Best for serverless/Edge Functions with many short-lived connections |
The direct connection is a real, dedicated Postgres backend process, so it supports every session-level Postgres feature but doesn't scale to thousands of concurrent short-lived clients. The transaction pooler trades some of those features away specifically to support very high connection concurrency cheaply, which is exactly the trade a serverless or Edge Function workload wants to make.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
