Four Ways to Run Server-Side Code on Eurobase: When to Pick Which

Eurobase has four distinct surfaces for running server-side code, and confusing them is a productivity tax. The SDK shape is similar enough that you can convince yourself eb.functions.invoke and eb.db.rpc are interchangeable. They are not. Today we shipped the missing piece — a UI for native PostgreSQL Database Triggers — and along with it a clean taxonomy so you pick the right tool the first time.
The four kinds
Cron Jobs. Scheduled SQL or RPC, fired by a cron expression. Runs without a caller, on its own. Use it for daily cleanup of expired sessions, weekly digest aggregation, archiving old rows.
RPC Functions. Reusable PostgreSQL functions (SQL or PL/pgSQL) you call by name from your app. eb.db.rpc('cleanup_expired_sessions') runs the function inside the database in a single round-trip. Use it for atomic multi-statement DB logic — a check-and-decrement, a computed leaderboard, a complex aggregate.
Database Triggers (the new bit). PL/pgSQL functions bound to a row event on a table — INSERT, UPDATE, DELETE, TRUNCATE. They fire automatically when your app writes a row. Use them for invariants that must hold at all costs: a max-N-rows-per-user constraint, auto-stamping updated_at, mirroring inserts into an audit table. The trigger runs inside the same transaction as the write, so if it raises, the write rolls back.
Edge Functions. Serverless TypeScript / JavaScript in a Deno container, completely outside the database. Use them when you need the JS ecosystem or external HTTP — payment provider webhooks, sending email, calling an image-processing API, custom OAuth flows.
A mental model that works
Cron Jobs are scheduled SQL. RPC is callable SQL. Triggers are reactive SQL. Edge Functions are everything else. The first three all live inside Postgres and share its transactional model. Edge Functions are a separate runtime that talks to your database the way your app does.
What's new in the console
Until today, you could create a function that returns trigger (it lived in pg_proc), but there was no UI to attach it to a table. The only way was to crack open the SQL editor and run CREATE TRIGGER by hand. Today's release adds a Triggers panel under each table on the Database tab — same accordion shape as the existing Indexes panel. Pick a function from the picker, set timing (BEFORE / AFTER), events (INSERT / UPDATE / DELETE / TRUNCATE), and granularity (FOR EACH ROW / FOR EACH STATEMENT), optionally a WHEN clause, and click Create. The trigger is wired up in one round-trip.
We also rewrote the docs around this. The "Server-side logic in Eurobase" section now has a four-column comparison table covering language, transactional semantics, where each one is managed, use-case examples, and a "pick when" row — so the next time you wonder "should this be RPC or an Edge Function?", the answer is one click away.
Sovereign by default
All four runtimes stay inside Europe. Cron, RPC, and Triggers run inside your project's PostgreSQL instance on Scaleway in France. Edge Functions run in the same Scaleway cluster. The platform never routes server-side execution through non-EU infrastructure — sovereign by design, GDPR-native by default.
Where to read more
- ▸Full comparison table and per-runtime walkthrough: console.eurobase.app/docs → Edge Functions chapter
- ▸The new Triggers panel: open any table on the Database tab in your project, scroll past the row data, expand the Triggers strip below Indexes.
- ▸Don't have a Eurobase project yet? Sign up free.
If you've been hand-rolling triggers via the SQL editor or wondering whether your "send confirmation email" logic belongs in an RPC or an Edge Function, the answers are now built into the platform. Ship faster, with the right tool.