Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Build 3 (#19663)

Francesco Sansalvadoredabb62e1e0bc
diff --git a/apps/www/_blog/2023-12-13-supavisor-postgres-connection-pooler-ga.mdx b/apps/www/_blog/2023-12-13-supavisor-postgres-connection-pooler-ga.mdx
deleted file mode 100644
index f1c280dfaad..00000000000
--- a/apps/www/_blog/2023-12-13-supavisor-postgres-connection-pooler-ga.mdx
+++ /dev/null
@@ -1,122 +0,0 @@
----
-title: 'Supavisor 1.0: a scalable connection pooler for Postgres'
-description: 'Supavisor is now used across all projects, providing a scalable and cloud-native Postgres connection pooler that can handle millions of connections'
-launchweek: X
-categories:
- - product
-tags:
- - launch-week
- - supavisor
- - postgres
-date: '2023-12-11'
-published_at: '2023-12-11T09:00:00.000-07:00'
-toc_depth: 3
-author: chasers,stas
-image: lwx-supavisor/supavisor-og.png
-thumb: lwx-supavisor/supavisor-thumb.png
----
-
-After [launching Supavisor in August](https://supabase.com/blog/supavisor-1-million), we've successfully migrated all projects on the platform. Every new Supabase project launched now gets a Supavisor connection string to use for connection pooling.
-
-Supavisor 1.0 symbolizes production readiness and comes with many bug fixes. It includes three important features:
-
-1. query load balancing
-2. named prepared statement support
-3. query cancelation
-
-## What is connection pooling?
-
-Supavisor is built with Elixir. Since the [Dashbit](https://dashbit.co/) team have been helping with the development we invited Jose Valim, the creator of Elixir, to explain connection pooling, OTP, and why Elixir is a great fit for a connection pooler:
-
-<div className="video-container">
- <iframe
- className="w-full"
- src="https://www.youtube-nocookie.com/embed/ogYNmJOFEpk"
- title="YouTube video player"
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
- allowfullscreen
- />
-</div>
-
-## SQL parsing with Rust
-
-To implement the latest set of features, we now parse all SQL statements from connected clients.
-
-Supavisor, developed in Elixir, supports high concurrency and rapid I/O. Elixir doesn't have great performance for parsing, but it provides excellent interop with Rust via [Rustler](https://github.com/rusterlium/rustler). For efficient SQL parsing, we use [`pg_query.rs`](https://github.com/pganalyze/pg_query.rs).
-
-## Load Balancing
-
-When set up with a Postgres cluster, Supavisor load-balances read requests between the primary server and its replicas. It randomly distributes these read requests across the entire Postgres cluster.
-
-Supavisor targets write operations to the primary automatically by probing read replicas until it hits the primary with a successful write, [similar to libpq](https://www.percona.com/blog/seamless-application-failover-using-libpq-features-in-postgresql/). The trade-off here is that writes may take a few milliseconds longer to complete in favor of zero additional client-side complexity. This write strategy also makes transparent primary failovers painless because detecting the primary for writes is automatic.
-
-### Read-after-writes
-
-With automatic primary detection, it's easy to guarantee read-after-writes from the same client by wrapping the read and write in a transaction.
-
-Future work is planned to allow custom server targeting with SQL statements such as
-
-```
-SET SERVER 'primary';
-```
-
-to let clients guarantee read-after-writes outside of transactions or across clients.
-
-## Named Prepared Statements
-
-Many clients use named [prepared statements](https://www.postgresql.org/docs/current/sql-prepare.html) when generating parameterized SQL. During statement preparation Postgres parses, plans, and optimizes queries.
-
-If a client can create named prepared statements, then such a client can re-use these query plans and simply submit parameters for them.
-
-The difficulty with named prepared statements and transaction-mode pooling is that statements are not shared across Postgres backends (connections). Each client connection must issue prepared statements for each query they will run.
-
-To solve this, Supavisor parses each query and identifies `PREPARE` statements. When a `PREPARE` statement is received on one connection it is broadcast across all connections. This approach allows every client to access named prepared statements that have been issued by other connections. This adds a slight increase in memory overhead when duplicating query plans for each Postgres connection but should come with significant throughput gains.
-
-<Img
- src={{
- dark: '/images/blog/lwx-supavisor/prepared-statements-dark.png',
- light: '/images/blog/lwx-supavisor/prepared-statements-light.png',
- }}
- alt="Diagram explaining how named prepared statements work in Supavisor"
-/>
-
-## Query Cancelation
-
-Supavisor 1.0 officially supports query cancelation as well. If you're using `psql`, typing `Ctrl+C` will cancel any ongoing query.
-
-Especially useful if you accidentally run a heavy query!
-
-## Platform Updates
-
-For the Supavisor rollout, we maintained consistent pooling settings between PgBouncer and Supavisor. We're also raising the client connection limit for smaller projects in Supavisor. Here are the updated default configurations:
-
-| Database Size | default_pool_size | max_connections | default_max_clients |
-| ------------- | ----------------- | --------------- | --------------------- |
-| micro | 15 | 60 | 200 |
-| small | 15 | 90 | 1000 (previously 200) |
-| medium | 15 | 120 | 1000 (previously 200) |
-| large | 15 | 160 | 1000 (previously 300) |
-| xl | 20 | 240 | 1000 (previously 700) |
-| 2xl | 25 | 380 | 1500 |
-| 4xl | 32 | 480 | 3000 |
-| 8xl | 64 | 490 | 6000 |
-| 12xl | 96 | 500 | 9000 |
-| 16xl | 128 | 500 | 12000 |
-
-In this table:
-
-- `default_pool_size`: the number of connections from Supavisor to your database (configurable)
-- `max_connections`: the max number of direct connections Postgres is configured to allow (configurable)
-- `default_max_clients` : the maximum number of clients allowed to connect to Supavisor (upgrade to increase)
-
-### IPv4 Deprecation
-
-Effective February 1, 2024 [AWS is charging for all allocated IPV4 addresses](https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/). Rather than passing that fee onto our customers Supavisor can mediate connections from IPv4 to IPv6.
-
-If you're using the PgBouncer connection string and haven't migrated to the new Supavisor connection string make sure to [do this before January 15th, 2024](https://github.com/orgs/supabase/discussions/17817).
-
-## Getting started
-
-If you're looking to self-host Supavisor, check out [GitHub repository](https://github.com/supabase/supavisor) and [documentation](https://supabase.github.io/supavisor/).
-
-Supavisor 1.0 is rolling out to the Supabase platform next week along with the new pooling configuration changes. If you've set a custom pooler configuration, or we've set one for you, your settings won't change. You can access the pooler URL in your [database settings](https://supabase.com/dashboard/project/_/settings/database).
diff --git a/apps/www/components/LaunchWeek/X/LWXMeetups.tsx b/apps/www/components/LaunchWeek/X/LWXMeetups.tsx
index f88fd1e676f..3eb92fb246a 100644
--- a/apps/www/components/LaunchWeek/X/LWXMeetups.tsx
+++ b/apps/www/components/LaunchWeek/X/LWXMeetups.tsx
@@ -98,6 +98,7 @@ const LWXMeetups = ({ meetups }: { meetups?: Meetup[] }) => {
return (
<Link
+ key={meetup.id}
href={meetup.link ?? ''}
target="_blank"
onClick={() => handleSelectMeetup(meetup)}
diff --git a/apps/www/components/LaunchWeek/X/Releases/components/AdventCard.tsx b/apps/www/components/LaunchWeek/X/Releases/components/AdventCard.tsx
index 9c258019791..0bc5675bf62 100644
--- a/apps/www/components/LaunchWeek/X/Releases/components/AdventCard.tsx
+++ b/apps/www/components/LaunchWeek/X/Releases/components/AdventCard.tsx
@@ -58,7 +58,7 @@ const AdventCard = ({ day, index }: { day: AdventDay; index: number }) => {
}}
>
<motion.div
- className="opacity-0 flex flex-col justify-between w-full aspect-square p-6 rounded-xl bg-[#121516] transition-colors text-[#575E61] border hover:border-strong overflow-hidden"
+ className="opacity-0 flex flex-col justify-between w-full h-full p-6 rounded-xl bg-[#121516] transition-colors text-[#575E61] border hover:border-strong overflow-hidden"
variants={variants}
>
<div className="opacity-30 group-hover:opacity-100 transition-opacity">{day.icon}</div>
@@ -84,6 +84,7 @@ const AdventCard = ({ day, index }: { day: AdventDay; index: number }) => {
<div className="flex gap-1 mt-3 flex-wrap">
{day.links?.map((link: AdventLink) => (
<Link
+ key={link.url}
href={link.url}
target={link.target ?? '_self'}
className="px-2 py-1 pointer-events-auto border border-muted transition-colors text-foreground-light bg-[#191D1E] hover:bg-[#22272A] rounded text-xs"
diff --git a/apps/www/components/LaunchWeek/X/Releases/components/index.tsx b/apps/www/components/LaunchWeek/X/Releases/components/index.tsx
index 5b57b9618a8..fef7d40e3d0 100644
--- a/apps/www/components/LaunchWeek/X/Releases/components/index.tsx
+++ b/apps/www/components/LaunchWeek/X/Releases/components/index.tsx
@@ -114,7 +114,7 @@ export const DayLink = ({ type, icon, text, href = '', className }: DayLink) =>
const Icon = icon ?? linkTypes[type].icon
const Text = () => <>{text ?? linkTypes[type]?.text}</>
- const Component = type === 'video' ? 'button' : Link
+ const Component = type === 'video' ? 'div' : Link
const Asd = ({ component: Comp, ...props }: any) => (
<Comp
diff --git a/apps/www/components/LaunchWeek/X/Releases/data/lwx_advent_days.tsx b/apps/www/components/LaunchWeek/X/Releases/data/lwx_advent_days.tsx
index cc5743e164a..5eecc54f435 100644
--- a/apps/www/components/LaunchWeek/X/Releases/data/lwx_advent_days.tsx
+++ b/apps/www/components/LaunchWeek/X/Releases/data/lwx_advent_days.tsx
@@ -193,31 +193,67 @@ export const days: AdventDay[] = [
image: '',
},
{
- title: '',
+ title: 'PostgREST 12',
+ description: 'PostgREST 12 is out: take a look at some of the major new features',
type: '',
- is_shipped: false,
- className: 'xl:col-span-2 xl:aspect-auto h-full',
- icon: '',
- id: '',
+ is_shipped: true,
+ className: 'xl:col-span-2 xl:h-auto xl:aspect-auto',
+ icon: (
+ <svg
+ width="27"
+ height="40"
+ viewBox="0 0 27 40"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M15.0322 36.3902L14.3034 37.2516C11.7407 35.013 7.01284 29.8864 8.60341 27.2884C10.194 24.6905 13.3899 25.1014 14.789 25.6316L7.74209 18.2973L11.8373 13.1528C13.3448 11.2589 13.3997 8.5907 11.9712 6.63648L9.15036 2.77743C8.9936 2.56299 9.03699 2.26258 9.24801 2.10126C9.45574 1.94245 9.7517 1.97543 9.91937 2.17607L18.8316 12.8409C17.6386 13.8717 15.1335 16.8169 14.6563 20.3515C14.1791 23.8861 18.1983 27.8627 20.2675 29.4092L19.5164 30.3589C16.4015 28.7684 12.9333 29.5417 11.9833 31.552C11.2234 33.1603 13.6993 35.4476 15.0322 36.3902Z"
+ fill="#EDEDED"
+ />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M8.19759 0.72708C9.14118 0.00571147 10.4855 0.155532 11.2472 1.06693L19.3767 10.7951L26.0245 10.7951L26.0244 11.6733L20.1105 11.6733L21.2505 13.0375L19.963 14.1501C19.4762 14.5707 18.6221 15.6091 17.8598 16.8512C17.6227 17.2375 17.3991 17.6362 17.2004 18.035H26.0239V18.9131H16.8061C16.5747 19.4971 16.4176 20.0613 16.3731 20.5649C16.2712 21.718 16.778 23.0811 17.8987 24.5981C18.0694 24.8291 18.2477 25.055 18.4306 25.2745H26.024V26.1526H19.2161C19.968 26.9389 20.7262 27.5922 21.3035 28.0236L22.7276 29.088L20.2085 32.2733H26.0243V33.1515H14.0831L14.0904 33.1609C14.6453 33.8766 15.456 34.571 16.0314 34.978L17.5719 36.0674L14.4036 39.5637L13.9864 39.2718L13.1656 38.5547C11.8166 37.3764 9.88352 35.4297 8.47296 33.3885C8.41881 33.3101 8.36506 33.2311 8.31182 33.1515H0.193359V32.2733H7.76359C7.35983 31.575 7.01869 30.8459 6.80346 30.1156C6.47287 28.9938 6.37285 27.6191 7.12826 26.3853C7.17696 26.3057 7.22678 26.2282 7.27763 26.1526H0.193359V25.2745H7.99604C8.77306 24.4921 9.68669 24.0215 10.597 23.7655L5.93479 18.9131H0.193359V18.035H5.7401L10.484 12.0755C10.5868 11.9464 10.6796 11.812 10.7625 11.6733H0.193359V10.7951H11.1403C11.4367 9.74213 11.2506 8.58204 10.5748 7.6576L7.75399 3.79855C7.04195 2.82446 7.23903 1.45989 8.19759 0.72708ZM18.7299 31.8999L19.4613 32.2733H13.5844C13.5737 32.2303 13.5685 32.1938 13.5665 32.1666L13.5658 32.1543C13.7319 31.8503 14.2141 31.4922 15.2427 31.3084C16.2341 31.1312 17.4976 31.2706 18.7299 31.8999ZM10.6345 1.57894C10.147 0.99558 9.2865 0.899685 8.68253 1.36141C8.06899 1.83046 7.94285 2.70388 8.3986 3.32736L11.2194 7.1864C12.4002 8.80178 12.3549 11.0073 11.1087 12.5728L6.50588 18.3551L12.1887 24.2697L11.442 24.3942C10.1196 24.6147 8.73644 25.2878 7.80923 26.8022C7.21941 27.7656 7.27116 28.878 7.56936 29.8899C7.86856 30.9052 8.45125 31.9526 9.12984 32.9346C10.491 34.9042 12.3731 36.8023 13.6908 37.9534L14.4036 38.5759L16.3999 36.2165L15.5703 35.6299C14.9529 35.1932 14.0769 34.4466 13.4594 33.6501C13.1504 33.2516 12.9395 32.8829 12.839 32.5695C12.7985 32.4432 12.7775 32.3253 12.7702 32.2245C12.7639 32.1379 12.7645 32.0243 12.7975 31.9239L12.7981 31.9221L12.8159 31.8696L12.8256 31.8489C13.1406 31.1825 13.9487 30.7285 15.1022 30.5224C16.2707 30.3135 17.7106 30.4829 19.093 31.1888L19.7734 31.5362L21.5923 29.2363L20.8255 28.6632C19.8489 27.9334 18.3962 26.6151 17.2565 25.0725C16.0848 23.4867 15.451 21.9285 15.5777 20.4946C15.6911 19.2121 16.3986 17.7055 17.1793 16.4335C17.9625 15.1575 18.8667 14.0421 19.4409 13.5459L20.1342 12.9469L10.6345 1.57894Z"
+ fill="#EDEDED"
+ />
+ </svg>
+ ),
+ id: 'postgrest-12',
links: [
{
- url: '',
- label: '',
+ url: '/blog/postgrest-12',
+ label: 'Read blog post',
},
],
image: '',
},
{
- title: '',
+ title: 'Supavisor 1.0',
+ description: 'A scalable connection pooler for Postgres',
type: '',
- is_shipped: false,
+ is_shipped: true,
className: '',
- icon: '',
- id: '',
+ icon: (
+ <svg
+ width="33"
+ height="33"
+ viewBox="0 0 33 33"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M6.26747 1.22998C6.26747 0.677696 6.72413 0.22998 7.28747 0.22998H26.4058C26.9691 0.22998 27.4258 0.677696 27.4258 1.22998V7.96132C27.4258 8.5136 26.9691 8.96132 26.4058 8.96132H22.6745L25.7709 12.2508H31.671C32.2343 12.2508 32.691 12.6986 32.691 13.2508V19.9822C32.691 20.5345 32.2343 20.9822 31.671 20.9822H24.805C24.2417 20.9822 23.785 20.5345 23.785 19.9822V13.2508C23.785 13.2003 23.7889 13.1506 23.7962 13.1021L19.8986 8.96132H17.8671L17.889 12.251H20.2796C20.8429 12.251 21.2996 12.6987 21.2996 13.251V19.5681L26.5941 24.7588C26.8782 24.6939 27.1743 24.6596 27.4786 24.6596C29.6219 24.6596 31.3594 26.363 31.3594 28.4643C31.3594 30.5656 29.6219 32.269 27.4786 32.269C25.3353 32.269 23.5978 30.5656 23.5978 28.4643C23.5978 27.4111 24.0342 26.4579 24.7395 25.769L19.8571 20.9823H17.8666V24.7924C19.5151 25.2315 20.7274 26.7091 20.7274 28.4643C20.7274 30.5656 18.9899 32.269 16.8466 32.269C14.7033 32.269 12.9658 30.5656 12.9658 28.4643C12.9658 26.7091 14.1781 25.2315 15.8266 24.7924V20.9823H13.8361L8.98258 25.7407C9.70503 26.4317 10.1536 27.3967 10.1536 28.4643C10.1536 30.5656 8.41609 32.269 6.27277 32.269C4.12945 32.269 2.39195 30.5656 2.39195 28.4643C2.39195 26.363 4.12945 24.6596 6.27277 24.6596C6.56016 24.6596 6.84025 24.6902 7.10983 24.7483L12.3936 19.5681V13.251C12.3936 12.6987 12.8503 12.251 13.4136 12.251H15.849L15.827 8.96132H13.9686L9.83174 13.3563V19.9822C9.83174 20.5345 9.37508 20.9822 8.81174 20.9822H1.94578C1.38245 20.9822 0.925781 20.5345 0.925781 19.9822V13.2508C0.925781 12.6986 1.38245 12.2508 1.94578 12.2508H8.09635L11.1927 8.96132H7.28747C6.72413 8.96132 6.26747 8.5136 6.26747 7.96132V1.22998ZM7.79174 14.2508H2.96578V18.9822H7.79174V14.2508ZM14.4336 18.9823H19.2596V14.251H14.4336V18.9823ZM6.991 26.8021C6.77031 26.7104 6.52759 26.6596 6.27277 26.6596C5.25611 26.6596 4.43195 27.4676 4.43195 28.4643C4.43195 29.461 5.25611 30.269 6.27277 30.269C7.28942 30.269 8.11359 29.461 8.11359 28.4643C8.11359 27.7198 7.65369 27.0805 6.99721 26.8047C6.99514 26.8039 6.99307 26.803 6.991 26.8021ZM16.7407 26.6625C15.7733 26.7163 15.0058 27.5025 15.0058 28.4643C15.0058 29.461 15.83 30.269 16.8466 30.269C17.8633 30.269 18.6874 29.461 18.6874 28.4643C18.6874 27.5025 17.9199 26.7163 16.9525 26.6625C16.9177 26.6661 16.8824 26.6679 16.8466 26.6679C16.8109 26.6679 16.7755 26.6661 16.7407 26.6625ZM26.7264 26.8167C26.0847 27.0986 25.6378 27.7303 25.6378 28.4643C25.6378 29.461 26.4619 30.269 27.4786 30.269C28.4952 30.269 29.3194 29.461 29.3194 28.4643C29.3194 27.4676 28.4952 26.6596 27.4786 26.6596C27.2144 26.6596 26.9631 26.7142 26.736 26.8125C26.7328 26.8139 26.7296 26.8153 26.7264 26.8167ZM25.825 14.2508V18.9822H30.651V14.2508H25.825ZM8.30747 2.22998V6.96132H25.3858V2.22998H8.30747Z"
+ fill="#EDEDED"
+ />
+ </svg>
+ ),
+ id: 'supavisor',
links: [
{
- url: '',
- label: '',
+ url: '/blog/supavisor-postgres-connection-pooler',
+ label: 'Read blog post',
},
],
image: '',
diff --git a/apps/www/lib/redirects.js b/apps/www/lib/redirects.js
index 4be0e8c6ac9..b33ba8c3b50 100644
--- a/apps/www/lib/redirects.js
+++ b/apps/www/lib/redirects.js
@@ -630,6 +630,11 @@ module.exports = [
source: '/join',
destination: 'https://supabase.com/',
},
+ {
+ permanent: true,
+ source: '/blog/supavisor-postgres-connection-pooler-ga',
+ destination: '/blog/supavisor-postgres-connection-pooler',
+ },
{
permanent: true,
source: '/blog/2022/06/15/blog/2022/06/29/visualizing-supabase-data-using-metabase',
diff --git a/apps/www/public/rss.xml b/apps/www/public/rss.xml
index 66b3552bb87..1d7fe9d034b 100644
--- a/apps/www/public/rss.xml
+++ b/apps/www/public/rss.xml
@@ -5,9 +5,23 @@
<link>https://supabase.com</link>
<description>Latest news from Supabase</description>
<language>en</language>
- <lastBuildDate>Mon, 11 Dec 2023 23:00:00 GMT</lastBuildDate>
+ <lastBuildDate>Tue, 12 Dec 2023 23:00:00 GMT</lastBuildDate>
<atom:link href="https://supabase.com/rss.xml" rel="self" type="application/rss+xml"/>
<item>
+ <guid>https://supabase.com/blog/supavisor-postgres-connection-pooler</guid>
+ <title>Supavisor 1.0: a scalable connection pooler for Postgres</title>
+ <link>https://supabase.com/blog/supavisor-postgres-connection-pooler</link>
+ <description>Supavisor is now used across all projects, providing a scalable and cloud-native Postgres connection pooler that can handle millions of connections</description>
+ <pubDate>Tue, 12 Dec 2023 23:00:00 GMT</pubDate>
+</item>
+<item>
+ <guid>https://supabase.com/blog/postgrest-12</guid>
+ <title>PostgREST 12</title>
+ <link>https://supabase.com/blog/postgrest-12</link>
+ <description>PostgREST 12 is out and we take a look at some of the major new features like JWT Caching and Aggregate Functions</description>
+ <pubDate>Tue, 12 Dec 2023 23:00:00 GMT</pubDate>
+</item>
+<item>
<guid>https://supabase.com/blog/edge-functions-node-npm</guid>
<title>Edge Functions: Node and native npm compatibility</title>
<link>https://supabase.com/blog/edge-functions-node-npm</link>
diff --git a/packages/ui/src/components/CountdownWidget/CountdownWidget.tsx b/packages/ui/src/components/CountdownWidget/CountdownWidget.tsx
index 4038d4cb63d..c167788378a 100644
--- a/packages/ui/src/components/CountdownWidget/CountdownWidget.tsx
+++ b/packages/ui/src/components/CountdownWidget/CountdownWidget.tsx
@@ -11,27 +11,31 @@ interface CountdownWidgetProps {
function CountdownWidget({ days, hours, minutes, seconds, showCard = true }: CountdownWidgetProps) {
const Colon = () => <span className="text-xs mx-px text-foreground-lighter">:</span>
+ const showItem = (item: string | undefined) => item !== undefined && item !== '0'
+
return (
<div className="flex gap-1 items-center">
- {days !== undefined && (
+ {days && showItem(days) ? (
<>
<CountdownStep value={days} unit="d" showCard={showCard} />
<Colon />
</>
- )}
- {hours !== undefined && (
+ ) : null}
+ {hours && showItem(hours) ? (
<>
<CountdownStep value={hours} unit="h" showCard={showCard} />
<Colon />
</>
- )}
- {minutes !== undefined && (
+ ) : null}
+ {minutes && showItem(minutes) ? (
<>
<CountdownStep value={minutes} unit="m" showCard={showCard} />
{seconds !== undefined && <Colon />}
</>
- )}
- {seconds !== undefined && <CountdownStep value={seconds} unit="s" showCard={showCard} />}
+ ) : null}
+ {seconds && showItem(seconds) ? (
+ <CountdownStep value={seconds} unit="s" showCard={showCard} />
+ ) : null}
</div>
)
}