Sr. Developer Advocate
Supavisor is Supabase's new connection pooler, now available on all new project (and being added to existing projects by Oct 15th). This is now the recommended connection method when creating a Supabase datasource in Appsmith.
Release Notes: https://github.com/orgs/supabase/discussions/17817
In this post, we'll dive-in and see what connection pooling is all about, and why Supabase is upgrading from the old
pgboucer that you may be more familiar with. We'll also discuss the shift to IPv6, which was a major factor in this connection pooler update. And lastly, we'll review the new, recommended method for creating a Supabase datasource in Appsmith.
Direct connections are just like they sound; you initiate a connection when needed and close it when you're done, just like calling someone on the phone. However, this can be resource-intensive, as each new connection setup and tear-down consumes valuable server resources. In scenarios with high traffic or numerous simultaneous requests, this can lead to performance bottlenecks, impacting the overall user experience.
Although a direct connection from Appsmith will work at first, you'll likely see connection issues after heavy use, which may require rebooting the project in Supabase, or waiting for connections to close. To avoid this, connection pooling should be used.
Connection pooling, on the other hand, optimizes resource utilization. Instead of opening and closing connections for every request, a pool of connections is maintained. These connections are reused as needed, reducing the overhead of repeatedly establishing new connections. The pooler also has logic and settings for when to close connections and how many to allow per user, or overall.
Supabase has released this new connection pooler to add support for IPv6. IPv4 and IPv6 are address systems used to identify devices on the internet.
The move from IPv4 to IPv6 is imperative. IPv4, with its 32-bit addressing scheme, has been the backbone of the internet for decades. However, the explosive growth of internet-connected devices and services has exhausted available IPv4 addresses.
The shortage of IPv4 addresses hampers the expansion of the internet. Network Address Translation (NAT) has been used as a workaround, but it adds complexity and can cause issues with certain applications. Additionally, IPv4's limited address space is a major security concern.
IPv6 offers a vast pool of unique addresses, thanks to its 128-bit addressing system. This not only solves the address shortage but also simplifies network configurations. IPv6 brings enhanced security features and enables more efficient data routing.
Make sure you use the right connection string! The new format looks like this:
Notice the differences in the URL:
aws-0-us-west-1.pooler.supabase.com) instead of the project ID being in the URL
Using this configuration will ensure your Appsmith connections to Supabase remain performant and responsive.
Connection pooling is a vital technique for optimizing database connections, particularly in high-traffic scenarios. The transition from IPv4 to IPv6 is equally crucial for the internet's sustained growth and security. Supabase will eventually be deprecating the pgbouncer pooler, make sure to switch over to Supavisor before the deadline.