Get fluent in Convex's backend vocabulary — reactive queries, transactional mutations, actions for external I/O, and scheduled functions.
0 / 5 completed
1 / 5
In a PR review, a teammate questions why a data-writing function is defined as a mutation in Convex instead of an action. The reason is:
Convex mutations run inside a serialisable transaction against the Convex database, ensuring consistency. Actions can call external services and await promises but cannot transactionally read/write Convex tables.
2 / 5
A standup question: your React component subscribes to data with useQuery. A junior asks what makes useQuery different from a fetch call. The correct answer is:
Convex useQuery hooks into the Convex sync engine. When underlying data changes, Convex pushes an update over a WebSocket and the component re-renders — no polling needed.
3 / 5
In a design review, you propose using Convex scheduled functions to send a reminder email 24 hours after sign-up. How are scheduled functions defined in Convex?
ctx.scheduler.runAfter(delay, fn, args) schedules a Convex function to run after a delay in milliseconds. You can also use runAt(timestamp, ...) or cron syntax in crons.ts.
4 / 5
A PR introduces a Convex query that reads from two tables. A reviewer asks whether Convex queries can have side effects. The correct answer is:
Convex queries are pure, read-only, and deterministic. They run inside a read transaction and cannot write, call external services, or schedule functions — those operations belong to mutations and actions.
5 / 5
In a standup, a team member asks what Convex actions are for, since mutations already handle writes. The best use case for actions is:
Convex actions are for side effects and external I/O — calling Stripe, an LLM API, or sending an email. They can call mutations/queries via ctx.runMutation/ctx.runQuery to persist results.