Files
supabase/apps/docs/content/guides/cron.mdx

29 lines
1.3 KiB
Plaintext

---
title: 'Cron'
subtitle: 'Schedule Recurring Jobs with Cron Syntax in Postgres'
---
Supabase Cron is a Postgres Module that simplifies scheduling recurring Jobs with cron syntax and monitoring Job runs inside Postgres.
Cron Jobs can be created via SQL or the Cron interface inside of Supabase Dashboard and can run anywhere from every second to once a year depending on your use case.
Every Job can run SQL snippets or database functions with zero network latency or make an HTTP request, such as invoking a Supabase Edge Function, with ease.
<Admonition type="note">
For best performance, we recommend no more than 8 Jobs run concurrently. Each Job should run no more than 10 minutes.
</Admonition>
## How does Cron work?
Under the hood, Supabase Cron uses the [`pg_cron`](https://github.com/citusdata/pg_cron) Postgres database extension which is the scheduling and execution engine for your Jobs.
The extension creates a `cron` schema in your database and all Jobs are stored on the `cron.job` table. Every Job's run and its status is recorded on the `cron.job_run_details` table.
The Supabase Dashboard provides and interface for you to schedule Jobs and monitor Job runs. You can also do the same with SQL.
## Resources
- [`pg_cron` GitHub Repository](https://github.com/citusdata/pg_cron)