Convex combines database, serverless functions, and real-time sync. Queries automatically update when data changes. TypeScript functions run server-side. Transactions ensure consistency.
Data Model
Define schemas with TypeScript. Documents stored in tables. Indexes optimize query performance. References link related documents.
- Define schemas with convex schema definition
- Write queries and mutations in TypeScript
- Use real-time subscriptions for live data
- Implement actions for external API calls
- Schedule functions for background tasks
Real-Time Sync
Queries re-run when underlying data changes. Clients receive updates automatically. No manual cache invalidation. Optimistic updates provide instant feedback.