Overview
Serverless databases pair naturally with event-driven AI. ModelRiver generates structured data, delivers it via webhook, and your handler writes it directly to the database: no dedicated server infrastructure required.
The pattern:
- Your app sends an async AI request via
/v1/ai/async - ModelRiver generates structured output and delivers it to your webhook
- Your webhook handler writes the data to your serverless database
- Your handler calls back to ModelRiver with the enriched result (including database IDs, timestamps, etc.)
- ModelRiver pushes the final result to the connected frontend
Supported platforms
| Platform | Type | Highlights | Guide |
|---|---|---|---|
| Supabase | Postgres + BaaS | Row-level security, real-time subscriptions, edge functions | View guide → |
| PlanetScale | MySQL-compatible | Branching, zero-downtime schema changes, Vitess engine | View guide → |
| Neon | Serverless Postgres | Branching, autoscaling, connection pooling, serverless driver | View guide → |
| Convex | Reactive database | Real-time queries, server functions, automatic caching | View guide → |
Common architecture
Frontend → POST /v1/ai/async → ModelRiver (AI) │ ▼ Webhook delivery │ ▼ Your webhook handler │ ┌────────────┼────────────┐ ▼ ▼ ▼ Supabase PlanetScale Neon (insert) (insert) (insert) │ │ │ └────────────┼────────────┘ │ ▼ POST callback_url (with database IDs) │ ▼ ModelRiver → WebSocket → FrontendNext steps
- Supabase guide: Postgres + real-time subscriptions
- PlanetScale guide: MySQL-compatible serverless
- Neon guide: Serverless Postgres with branching
- Convex guide: Reactive database with server functions