Connecting
Learn/L8 · Convex

What is Convex?

Convex is a backend platform that gives you a database, typed functions, and realtime — all in one.

Difficulty 3/5

Mental model

realtimeReact screenuseQuery / useMutationConvex functionDatabase

Plain English

Convex replaces the usual 'API + database + websocket' stack with one thing. You define a schema. You write functions (queries, mutations, actions) in TypeScript. Your React app calls them with useQuery/useMutation. Live updates are automatic.

Analogy

Convex is a kitchen, fridge, and serving hatch combined — you don't wire pipes between three rooms.

Jessica's wedding portal

useQuery(api.tasks.listForWedding, { weddingId }) returns the live task list — it auto-updates when anyone adds a task.

Agentify CRM

useMutation(api.conversations.assign) reassigns a conversation; every connected inbox sees it instantly.

Go deeper

Backend in a box: database + functions + realtime.

Common mistakes

  • Calling external APIs from a mutation. Use an action.
  • Skipping indexes and scanning the whole table.
  • Putting business rules in the React component instead of the function.

AI-agent trap

Agents confuse queries, mutations, and actions. Always state which one you want.
Quick check
Which Convex function would you use to save a new task?

Summary

Schema in convex/schema.ts. Queries (read), mutations (write), actions (talk to outside world) in convex/*.ts. React uses useQuery/useMutation. Subscriptions are automatic.

Confidence: