Loading…
Updates for Supabase Functions
Paul Copplestone
- Source
- Supabase
- Published
- Added to Yomu
Summary
Supabase has announced an Alpha release of Database Webhooks alongside dashboard management tools for native PostgreSQL Functions and Triggers. Database Webhooks act as a wrapper around PostgreSQL triggers, asynchronously emitting HTTP GET and POST requests whenever table data is inserted, updated, or deleted. The networking layer relies on a new PostgreSQL extension called pg_net, which pairs a PostgreSQL background worker queue with libcurl to handle multiple concurrent outbound requests without blocking SQL queries. Although pg_net currently processes over 300 requests per second, Supabase plans to expand capabilities to include direct triggers for AWS Lambda and Google Cloud Run before launching dedicated Supabase Functions.
Context
Supabase users, particularly Enterprise and Jamstack developers, requested the ability to trigger existing serverless functions and API routes directly from database events without vendor lock-in. Managing raw PostgreSQL functions and triggers was also difficult without dedicated dashboard interfaces.
Approach / What changed
Supabase introduced a native functions editor and trigger interface in the Dashboard, while launching Database Webhooks in Alpha. To support asynchronous HTTP dispatch from triggers without slowing database operations, Supabase developed the pg_net extension, which uses a PostgreSQL background worker and the libcurl multi interface to queue and execute non-blocking HTTP requests.
Takeaways
- Supabase developed pg_net, an asynchronous PostgreSQL networking extension that uses background workers and libcurl to send HTTP requests at over 300 requests per second.
- Database Webhooks capture INSERT, UPDATE, and DELETE row changes as triggers to deliver structured payloads matching Supabase Realtime format without needing an active client listener.
- The Supabase Functions rollout roadmap is staged across external HTTP webhooks, native AWS Lambda and Google Cloud Run execution via restricted IAM roles, and native Supabase Functions.