Understanding performance, response time & connection limits from a newbie point of view #7193
-
Hi everyone 👋🏻 I am about to start a massive-ish project using Supabase for a bit client and I have a few questions in terms of performance / limits as we can’t f*ck it up 😅 I have looked at previous discussions and I will probably contact support but from what I read I still have some areas I'd like more insights first. I'm sorry if some of these sound silly, Supabase is the first time I get acclimated with PostgreSQL and thus some base knowledge might not be fully grasped yet! Summary of the projectWe have two Next.js apps’ both revolving around a single Supabase project entirely consumed through its REST API JS client (supabase-js, read/write with auth/RLS & real-time); one is a simple registration form for participants to enter their personal details & the other is a tailor-made dashboard for the admin team to review said data. It is for a big client with a large target audience – our current solution lacks live audience metrics but in theory it can go to about 5000 concurrent visitors (we have about 35k potential registrants and send around 6k invitations each day; not everyone instantly jumps on the occasion) The project in itself is pretty simple, it’s rather the sheer amount of visitors that can cause friction (in terms of performance and $$$). Does 1 visitor = 1 connection?I understand from this answer that it can go high in terms of requests per second from a single connection but in my case I would need to understand if it needs to go up 5000 single connections, correct? Or maybe does the pooling in your REST API solution also apply for concurrent connections? I understand that the numbers coming from here and the error message are for direct PostgreSQL connections and thus not for my case, correct? At what price range starts the "Enterprise" plan?I know that every case is specific but from experience, the "contact us" plans usually have a huge gap between them and the most expensive listed plan (starting from 2k€ to 4k€/month and with yearly contracts enforced). Has anyone already used it and how is Supabase doing in that area in terms of costs? Regions and performanceFrom what I understand, my instance is deployed to a specific region and it would make sense that I place it the nearest to my admin team (let’s say France). My projects will probably be hosted on Vercel and thus their Edge network allows our registrants accross the world to access the apps with stellar performance. If I have visitors from the US, the Vercel performance will be good but maybe the Supabase’s connection will not. Thank you in advance for anyone reading through all this and taking the time to give any sort of insights, much appreciated 🙌🏻 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hello,
No. With connection pooling, many users can share a few database connections, you can have 10 connections serving a 1000 users. This is because in a web application the web users are not hitting the database constantly(GUI work, idleness, etc) and when they need to, they "borrow" a connection, fulfill a request and then "return" the connection to the pool. There are some more details on https://supabase.com/docs/guides/database/connecting-to-postgres Note that that refers to pgbouncer connections, only relevant when you do direct connections to postgres through your own language/framework. It doesn't affect the REST API. It might be more relevant for you to know the number of requests per second. For a 2XL addon, according to our REST API benchmarks you should get about 10249 read/s and 8931 write/s. |
Beta Was this translation helpful? Give feedback.
Hello,
No. With connection pooling, many users can share a few database connections, you can have 10 connections serving a 1000 users. This is because in a web application the web users are not hitting the database constantly(GUI work, idleness, etc) and when they need to, they "borrow" a connection, fulfill a request and then "return" the connection to the pool.
There are some more details on https://supabase.com/docs/guides/database/connecting-to-postgres
Note that that refers to pgbouncer connections, only relevant when you do direct connections to postgres through your own language/framework. It doesn…