All articles
![icon of an ear to represent event driven programming](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fd8e93833ad333febf696a70866d0db42c971d25a-1452x956.png&w=3840&q=75)
We go over the basics of event driven programming: how it works, benefits, variants, and use cases.
![Convex's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa7ae6922d84ee6b25c94992a47688132cc368a48-256x258.png&w=3840&q=75)
Convex
a day ago
Serve your app on a sub-path to host multiple apps on the same domain, using vercel.json rewrites.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
7 days ago
![icon of a gear and timer, representing scheduled cron jobs](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F44e629df62a6b4b9b576fc5b036f57485fa24a95-1452x956.png&w=3840&q=75)
Even though Convex supports the creation of cron jobs out of the box, until now, we've only supported static jobs. With user space crons, we now support the programmatic definition of crons at runtime.
![James Cowling's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0d9c8f867a3ecac0ce8efe417583dbab8ce458b3-400x400.jpg&w=3840&q=75)
James Cowling
9 days ago
![a page 1 icon and some brackets with ellipsis to represent pagination](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fbc67c72570874d7872c82f3eff063b8b435075a2-1452x956.png&w=3840&q=75)
Convex offers robust control over pagination with a powerful function, getPage, enabling complex edge cases. In this article, we go over how to use that function in your Convex app.
![Lee Danilek's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F3c79cdc687d19f0b05080ae217ed23e00b239f79-594x603.jpg&w=3840&q=75)
Lee Danilek
15 days ago
![padlock icon to represent auth](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa1bb13a6b67d4791bd1c91cc6e3315191240bbea-1452x956.png&w=3840&q=75)
Convex Auth is a library for implementing authentication natively in your Convex backend.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
16 days ago
![icon of logs and then icon of a stream, to represent log streaming!](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F4c39adb6412d669163f6c352a22919a6e654c7d9-1452x956.png&w=3840&q=75)
Log streams like Axiom and Datadog can be used to provide powerful querying and alerting on logs and errors from your Convex functions, helping with debugging issues when they come up and providing early insights to detect smaller issues before they become bigger.
This article covers how to do the several common things with either Axiom or Datadog hooked up as a Convex log stream including filtering to a request, logging structured metadata, and visualizing usage.
![Sarah Shader's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7047febd1fcf4e4b44d4da9f199c07d842acf23b-1365x1418.jpg&w=3840&q=75)
Sarah Shader
a month ago
![Icon of a person throwing a ball for a dog to fetch and a stream on the right, representing the post title](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa14a7923f28561ae8d5fc6551916e4137d09415d-1452x956.png&w=3840&q=75)
Learn the basics of HTTP streaming with Convex by re-implementing OpenAI's SDK using built-in fetch and async iterators. No npm dependencies needed.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a month ago
![an icon representing fullstack programming inside a paradoxical shape](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0babce96c1fe96bff331d35787e527b0884eb359-1452x956.png&w=3840&q=75)
When people want a full-stack framework, what they really want is an opinionated backend that interoperates seamlessly with their frontends in a way that empowers full-stack developers to easily build apps that can scale.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 months ago
![ai chat robot next to a river stream representing http streaming](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5b53664d39f47e3bf901ef88e483923708c954f0-1452x956.png&w=3840&q=75)
By leveraging HTTP actions with streaming, this chat app balances real-time responsiveness with efficient bandwidth usage. Users receive character-by-character updates to their own responses directly from ChatGPT, while other users see periodic updates, minimizing database bandwidth.
![Sarah Shader's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7047febd1fcf4e4b44d4da9f199c07d842acf23b-1365x1418.jpg&w=3840&q=75)
Sarah Shader
2 months ago
![A magnifying glass looking for a specific property next to a database, representing SELECT DISTINCT in SQL](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F92054aead711e0c745e3dd3d7c882c8548f3e4b9-1452x956.png&w=3840&q=75)
You'll often want to retrieve unique records from your database. While SELECT DISTINCT is the traditional way to do this in SQL databases, we've improved on this pattern in Convex by making it more consistent.
![Nipunn Koorapati's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F356ab217d41d241d51c70d467f187322bdab16fa-384x384.webp&w=3840&q=75)
Nipunn Koorapati
2 months ago
![Icon of rate limiting and then an icon of a bucket, representing token bucketing](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa4cc55ba563d64fc4551bf7de76e4c16279a0773-1452x956.png&w=3840&q=75)
Implementing application rate limiting when you have fast access to a database with strong ACID guarantees. Token bucket and fixed window, with fairness, burst accommodation and fire-and-forget support.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 months ago
![the definition of cache invalidation: a cache is a non-authoritative representation of data maintained for performance](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fb2a3fa71bdaacc1f58ea6f4c2e420e8aa7624a59-1473x829.png&w=3840&q=75)
A cache is a non-authoritative representation of data maintained for performance reasons. Find out what these words mean and when you should care about them here.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 months ago
![On the left, a distributed server icon, on the right a folder icon with a pirate's hook in it](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Feefa30990065ad4eb11c60b56539fde55b71c886-1452x956.png&w=3840&q=75)
Compare push-based load balancing with pull-based work stealing as scalable strategies for distributing resource-intensive workloads, such as running LLM models for AI apps.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 months ago
![A distributed server on the left and a folder icon with a pirate's hook in it](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc111196ddb6a2dc1b8cddd34df74240d276a3ea3-1452x956.png&w=3840&q=75)
Implementing "work stealing" - a workload distribution strategy - using Convex's reactive database.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 months ago
![Convex with Auth.js](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F4dc7625ae31824a01dcc6b178e4ad1cc7981ec2a-1194x786.png&w=3840&q=75)
Learn how to use Auth.js with your Next.js server and Convex backend to build a full-featured authentication system.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
3 months ago
![Next auth logo inside the convex logo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F02c9400d6c596d54158b582fd4fa17b3438274ba-2169x1380.png&w=3840&q=75)
Learn how to install and configure the Convex adapter for Auth.js as part of getting set up with Convex and Next.js.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
3 months ago
![image of a rocket taking off with a person standing to the left. on the right side of the image is an icon of a trophy.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F469c0e4cf55ac663672ae593c953bd1c5a936931-2178x1434.png&w=3840&q=75)
Earlier this year we ran a hackathon to find who could use Convex's features the best to build an application from scratch. From 2400 participants, Konrad Hylton pulled it off with Launchpie.
![Wayne Sutton's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5315e017038d975f7869440a221d60c4cc77d77d-1200x1200.jpg&w=3840&q=75)
Wayne Sutton
3 months ago
![Icon of a schema in a yellow box next to an icon of a file migration in a black box](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F74abeed88d680f9ae35e6e1020c3b0812b6b6a87-1452x956.png&w=3840&q=75)
Online migrations in Convex using mutations. Including a helper to track migration state!
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
3 months ago
![a database icon, an equals icon, followed by a spreadsheet icon](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F63501af4add2dba5e0dfe70353c73a180623d091-1452x956.png&w=3840&q=75)
I want to share my mental model of databases:
- Databases are just big spreadsheets
- An index is just a view of the spreadsheet sorted by one or more columns
- Binary search over a sorted list is faster than a linear scan (for large lists)
![Sarah Shader's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7047febd1fcf4e4b44d4da9f199c07d842acf23b-1365x1418.jpg&w=3840&q=75)
Sarah Shader
3 months ago
![the basics of operational maturity](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fab35bfadd43eab048cc3ed1c1b16a665545fb627-1452x956.png&w=3840&q=75)
This post will cover various aspects of operational maturity, and steps to take as your app grows up.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
4 months ago
![setting up your testing mvp for peace of mind](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F646095c9e79390fd2f7eb94fa3e77e1ee887578b-1452x956.png&w=3840&q=75)
Learn about best practices for testing your full-stack apps - running on Convex or elsewhere!
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
4 months ago
![how we scaled function execution by ten times](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fab7d6dad1cc1e0aa60ab6db62cf92123944e570f-1452x956.png&w=3840&q=75)
We shipped a behind-the-scenes update that lets customers run 10x concurrent functions than they used to. Emma, who helped ship the update, provides the context, architecture, and impact.
![Emma Forman Ling's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F258c4f123c30e2537527306140347d021bb64bab-384x403.webp&w=3840&q=75)
Emma Forman Ling
4 months ago
![How Convex works](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fb0bf18774ad7a59527d8da5c89860b16afa67b65-2132x1278.png&w=3840&q=75)
The full, unabridged story on how the Convex internals work.
![Sujay Jayakar's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F335db9757b2839925ac82b93a45f91ccfc3c6db7-300x300.webp&w=3840&q=75)
Sujay Jayakar
4 months ago
![building the open source backend from source](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F48d48ab051ba77aaaab9d6a897fd3c54fdfaa772-1452x956.png&w=3840&q=75)
Read this article to learn how you can build our open-source backend from source.
![Nipunn Koorapati's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F356ab217d41d241d51c70d467f187322bdab16fa-384x384.webp&w=3840&q=75)
Nipunn Koorapati
4 months ago
![Developing with the convex open-source binaries](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F047076e5eef9ee8750801b3dc364da268262ac3b-1452x956.png&w=3840&q=75)
Read this article to learn how you can develop against our open-source backend using our packaged binaries.
![Nipunn Koorapati's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F356ab217d41d241d51c70d467f187322bdab16fa-384x384.webp&w=3840&q=75)
Nipunn Koorapati
4 months ago
![Zero to one hackathon 2024 results](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F6cc4e1343f4a09b0fc2e7656b973cfaf91044aaf-1452x956.png&w=3840&q=75)
Contestants have been hard at work with our Winter Hackathon that we ran with Devpost. In this post, we announce the winners and their prizes!
![Wayne Sutton's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5315e017038d975f7869440a221d60c4cc77d77d-1200x1200.jpg&w=3840&q=75)
Wayne Sutton
4 months ago
![Observing your app in production](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F187dc4b1b0b95b1feda64d918c4802166fb613e7-1452x956.png&w=3840&q=75)
By setting up dedicated tools, you can get actionable data to help understanding errors, performance, user behavior and allow you respond quickly when things change.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
4 months ago
![How to build quickly when starting a project: yolo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F21415b0bd6a637a51a7172104b5e6ae2a7b7f04f-1452x956.png&w=3840&q=75)
Before you burden yourself with “best practices” for large-scale companies, focus on what will reduce your feedback cycles and help you ship early and often. Think about your use case, not your toolbox.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
4 months ago
![Using TypeScript to Write Complex Query Filters](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F38dc6174837f9b83847d729910c05356e62923e0-1452x956.png&w=3840&q=75)
There’s a new Convex helper to perform generic TypeScript filters, with the same performance as built-in Convex filters, and unlimited potential.
![Lee Danilek's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F3c79cdc687d19f0b05080ae217ed23e00b239f79-594x603.jpg&w=3840&q=75)
Lee Danilek
4 months ago
![Running tests using a local open-source backend](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F65ec03a882923d3e4f09948743e8acbfc92ca270-1452x956.png&w=3840&q=75)
Convex recently released an open source version of the backend. We can use this to unit test Convex functions by running them with a local backend. These tests will work by running a backend locally, pushing your code, and using the `ConvexClient` to execute queries and mutations from your favorite testing framework and asserting on the results.
![Sarah Shader's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7047febd1fcf4e4b44d4da9f199c07d842acf23b-1365x1418.jpg&w=3840&q=75)
Sarah Shader
4 months ago
![Bulk edit documents with a patch to apply](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F57bb95841c45f9b685c907b13b6bbfd718c8f3db-1452x956.png&w=3840&q=75)
Patch all of your data in your database table with the bulk edit feature on the Convex dashboard, without writing migration code.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
5 months ago
![Turning json into jsonl with jq -c '.[]' ./mydata.json > mydata.jsonl](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe7ae47d52ec3084511d893b8a8851580630aae32-1008x894.png&w=3840&q=75)
JSON Lines stores one JSON object per line in a file, which is more scalable. Here's the one-liner to convert your .json file to .jsonl
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
5 months ago
![Setup ESLint to enforce type checking and Typescript code quality](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc818fdda0370dfc1eba6ef650f2ac9af6daca4b2-2877x1911.png&w=3840&q=75)
ESLint is a powerful tool that goes beyond simply type checking. We go over how to set it up and implement some basic workflows with the
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
5 months ago
![Uploading files from React Native / Expo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F22521db33c22fe7c1072898d0a3c864d6c8fba21-1200x675.png&w=3840&q=75)
Step by step guide to take a file URI provided by Expo media APIs and upload it to Convex in React Native.
![Indy Khare's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F79a98842e44366073f00c01658ae87ce82ab2e57-829x827.jpg&w=3840&q=75)
Indy Khare
5 months ago
![The Software-Defined Database](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F518ea244a2bd3fd5f1d5c8bc598d2213179d0dcb-2877x1911.png&w=3840&q=75)
Which to choose, the expressive power of code, or the robustness of built-in database features? With Convex, you can have both. By eliminating the boundary between the application and the database, Convex provides a uniform and powerful way to model your entire backend data flow and security using plain ol' code.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
5 months ago
![AI-Powered Voice Note Taking](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe909383fb4836bf0402f012feb5d4fff397e05f6-2000x1047.png&w=3840&q=75)
I recently built a full-stack app called notesGPT. It allows you to record a voice note, transcribes it, and extract action items and display them as action items. It’s fully open source and comes equipped with authentication, storage, vector search, action items, and is fully responsive on mobile for ease of use.
![Hassan El Mghari's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8d384e248d778e8d9bd5f1ee56d0b8b05b236add-400x400.jpg&w=3840&q=75)
Hassan El Mghari
5 months ago
![Queries that scale: Indexing, Pagination, Read/Write Isolation](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7f643eef67eb9e887e594b8618d7543c36a345c9-2877x1911.png&w=3840&q=75)
As your app grows from tens to hundreds to thousands of users, there are some techniques that will keep your database queries snappy and efficient. I’ve put together a short list of the most common techniques used by teams scaling on Convex.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
5 months ago
![Retry your actions: use the power of convex scheduling](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F4c758d0a8ec559124d8f95014a7fd0ff8cec24c6-2877x1911.png&w=3840&q=75)
Learn how to automatically retry actions in Convex while also learning a little about scheduling, system tables, and function references.
![James Cowling's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0d9c8f867a3ecac0ce8efe417583dbab8ce458b3-400x400.jpg&w=3840&q=75)
James Cowling
5 months ago
![Comparing the realtime databases, firebase, convex, and supabase](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe125726518e86a360c8c162428d89165cec6a7a4-2877x1911.png&w=3840&q=75)
Learn about the existing options for databases that come with realtime elements and find out how they compare.
![Convex's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa7ae6922d84ee6b25c94992a47688132cc368a48-256x258.png&w=3840&q=75)
Convex
5 months ago
![improved npm run dev](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F40f7b662647447f6b71f3e7c8e319f6c87f66431-2493x1656.png&w=3840&q=75)
With a simple `npm run dev` we can sign up a user for Convex, add seed data, and run the frontend and backend (including database) in parallel. Here's how we do it, and how to undo it too.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
6 months ago
![Convex Ents: Bring your ORM workflow to Convex](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Faa99b3b6775fbc48f104fd36eaf99d4799336bf4-2700x1461.png&w=3840&q=75)
Convex Ents is a library that provides: simpler ways to model and query related documents, ability to easily map and filter documents, enforcing unique field values, default field values, cascading deletes, soft deletion and more!
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
6 months ago
![Session tracking without cookies?](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Ff9a86db1b6c80c48eb715cc96fef9df6d004298b-2493x1656.png&w=3840&q=75)
Advice and resources for session tracking per-tab or per-browser via localStorage / sessionStorage using React Context, hooks, and some utilities to make your life easier.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
6 months ago
![Using branded types in validators with type casting in your schema](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc4f22afbfdd39a1108047b1fb9dc3c596f9353db-2877x1911.png&w=3840&q=75)
If you have a more specific type than what you can express with Convex validators, you can still document that at the type level in Convex by casting once in your schema definition.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
6 months ago
![Transactions: definition, ACID, and examples](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F98a537815676f5e396e13dea596c6ba907331483-1918x1274.png&w=3840&q=75)
Understanding database transactions is essential for full-stack developers. So, what is a database transaction and how does it work?
![Convex's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa7ae6922d84ee6b25c94992a47688132cc368a48-256x258.png&w=3840&q=75)
Convex
6 months ago
![Code for joining queries with helpers for one-to-many, many-to-many, and more.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa27ff456078d5777de3cba0c91a13187f11f86e7-2670x1674.png&w=3840&q=75)
Traverse database relationships in a readable, predictable, and debuggable way. Support for one-to-one, one-to-many, and many-to-many via utility functions available in convex-helpers.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
6 months ago
![Argument validation without repetition: Advanced tips and tricks](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F57e2634a0f1f1d4ba6be467600176b61eb653e2f-2877x1911.png&w=3840&q=75)
A few more advanced techniques & helpers to further reduce duplication and accelerate your Convex workflow.
![Anjana Vakil's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F26b7f9ae04ef51725d117901c29166d930328d29-1080x1080.jpg&w=3840&q=75)
Anjana Vakil
6 months ago
![Clients: definition, design, and examples.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F47aed69edd20d98b2c6a9dddc63b78829c203338-2877x1911.png&w=3840&q=75)
Learn what a client is in the context of fullstack TypeScript development and understand the client's role in the client-server architecture.
![Convex's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa7ae6922d84ee6b25c94992a47688132cc368a48-256x258.png&w=3840&q=75)
Convex
6 months ago
![Use zCustomQuery to add zod argument validation](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fea0a87a780807ddd6d8c8decf9957bcbd53d53c3-2493x1620.png&w=3840&q=75)
Use Zod with TypeScript for argument validation on your server functions allows you to both protect against invalid data, and define TypeScript types that propagate to your client. This can now be used as an alternative to the built-in argument validation on Convex.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
7 months ago
![Customize your Convex functions with the new customQuery helper](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F3c158cf419a849c2b58b478df3d56188f1f8c140-2439x1276.png&w=3840&q=75)
Re-use code and centralize request handler definitions with discoverability and type safety and without the indirection of middleware or nesting of wrappers. Use the new customFunction module in convex-helpers for your Convex TypeScript functions.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
7 months ago
![Convex Build Bounty for CodeWithAntonio's Jotion: Announcing the Winners](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F1de9482af6c1dc4d9b7d895f1f2c5ebf91895c80-2700x1680.png&w=3840&q=75)
We hosted a hackathon for building features on top of a Notion clone created by CodeWithAntonio. Here are the results.
![Wayne Sutton's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5315e017038d975f7869440a221d60c4cc77d77d-1200x1200.jpg&w=3840&q=75)
Wayne Sutton
7 months ago
!["types and validators" in bold text. "best practices and useful tidbits" in light text. a colored cookbook](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F2e37683c8d8f26a209a9556b4a1ba280a84afbee-2853x1911.png&w=3840&q=75)
It can be tough to wrangle types to behave how you want them to. Thankfully, Convex was designed to make the experience with types perfect. Learn why that's the case here.
![Anjana Vakil's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F26b7f9ae04ef51725d117901c29166d930328d29-1080x1080.jpg&w=3840&q=75)
Anjana Vakil
8 months ago
![example of waiting customers](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7b791b80aabb4356909439d96f85ded9d4cdf4b5-1581x788.webp&w=3840&q=75)
Does your app need to limit the amount of users that can use it at a time? You might need to add a waitlist, which you will learn to build in this post.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
8 months ago
!["who's on call?" in black text, above an image of the pagerduty logo with a red arrow going to the slack logo.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F11c386ba9ccb6257c2808c4f4e145241b35f425f-2493x1620.png&w=3840&q=75)
Syncing your Pagerduty instance with Slack is a good way to stay on top of your on-call schedule. We cover syncing Pagerduty information with a Slack channel.
![Gautam Gupta's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F766e3fd855f25f2c0bef103d52c210cdade93245-384x384.webp&w=3840&q=75)
Gautam Gupta
8 months ago
![open AI logo followed by a text box with the word assistants API followed by a list of vector database logos with the skull emoji next to them](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc85f73514bad57b09d844e90b26da4be410e4748-1800x951.png&w=3840&q=75)
This year vector databases have sprung up like mushrooms to enable applications to retrieve context based on semantic search. A large portion of these applications have used the retrieved context to augment the ability of large language models (LLMs) in a pattern known as RAG. On November 7th OpenAI released its Assistants API, enabling the implementation of AI chat interfaces with context retrieval without needing a separate message store or vector database. Does this new API make vector databases obsolete?
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
8 months ago
![AI chat bot in a docs site](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F633b58f26a29b7e3de1a4d402aabc4ca0526b647-2400x1350.png&w=3840&q=75)
Convex is a full-stack development platform and cloud database, including built-in vector search. In this third post in our [series](https://stack.convex.dev/ai-chat-using-openai-assistants-api), we’ll build an AI-powered chat interface using Convex, with our own message storage and context retrieval.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
8 months ago
![AI chat bot in a docs site](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F633b58f26a29b7e3de1a4d402aabc4ca0526b647-2400x1350.png&w=3840&q=75)
In this second post in our series, we’ll build an AI-powered chat interface using LangChain and its new Convex integration.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
8 months ago
![AI chat bot in a docs site](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F633b58f26a29b7e3de1a4d402aabc4ca0526b647-2400x1350.png&w=3840&q=75)
On November 7th OpenAI released its Assistants API, enabling chat bot with context retrieval implementations without needing a messages or vector database. In this post, we’ll cover how to leverage this API to build a fully functioning AI chat interface.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
8 months ago
![Convex Build Bounty for CodeWithAntonio's Jotion: Build features and earn prizes](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5697781f51044cd2dbf0331538ba57cb286dcb6d-2700x1680.png&w=3840&q=75)
Learn how you can win cash prizes for building features on an open-source Notion clone.
![Wayne Sutton's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5315e017038d975f7869440a221d60c4cc77d77d-1200x1200.jpg&w=3840&q=75)
Wayne Sutton
8 months ago
![Text: "seeding preview deployments" in a red box. Below it is the text: "3 ways" in a yellow box. To the right is a small image of preview deployments.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc16f0d9dbf354efdfba8e38aafe50e9ac4b39219-1107x615.png&w=3840&q=75)
Now that we've launched Preview Deployments on Convex, you can test out backend changes easier than ever. But you may want to seed your project with data first, so let's go over how to do that.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
9 months ago
!["npm create convex" in monospace font](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0c7bc91d4802d3109370eb57f17235a7ef4b38e4-744x420.png&w=3840&q=75)
There’s a new fastest way to start building a new app on Convex. Use our new magical command, npm create convex, to spin up a new Convex app from a preexisting template.
![Convex's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa7ae6922d84ee6b25c94992a47688132cc368a48-256x258.png&w=3840&q=75)
Convex
9 months ago
![Convex and Fivetran logos over a colored stripe. Text reads: "Seamless data integration from Convex to your destinations of choice" alongside a stylized version of the Convex frontend.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F96bd8f1d1ba0fa293e9e76a8926dd1cff815a25b-2540x1520.png&w=3840&q=75)
Launching our official Convex Fivetran connector.
![Nipunn Koorapati's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F356ab217d41d241d51c70d467f187322bdab16fa-384x384.webp&w=3840&q=75)
Nipunn Koorapati
9 months ago
![The new AI town frontend with new assets, featuring a forest camp where the agents hang out.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8e8d1bc333f00c25425b9046ba4c245e5494198c-1573x1067.png&w=3840&q=75)
It's never been a better time to make your own town of AIs.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
9 months ago
![Multi-user chat with ChatGPT streaming responses.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F06d7d68a46f66ab06646707329adf2355ce55e86-960x540.gif&w=3840&q=75)
Stream GPT responses without brittle browser-based HTTP streaming.
Multiplayer reactivity, persistence, reactivity via Convex. Using OpenAI’s Node SDK server-side, and Convex's useQuery hook client-side.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
9 months ago
![AI Town](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fb1723317c83cd11e82d2f360e9450eb771668223-2122x1124.png&w=3840&q=75)
Learn more about how AI Town works and how to customize it. In this post, we'll dig into how character identities are represented: how to alter them, and how to add entirely new characters.
![Anjana Vakil's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F26b7f9ae04ef51725d117901c29166d930328d29-1080x1080.jpg&w=3840&q=75)
Anjana Vakil
a year ago
![Screenshot of an authentication UI](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fdb739d2bdf3a67c180e3d0b76340e96218fce8f7-2400x1350.png&w=3840&q=75)
Learn how to build a full stack app with authentication without any third-party auth providers, using Convex and the Lucia library.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
a year ago
![Convex starts a checkout with Stripe, then handles the success webhook](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F97b28bec28caa96cbf88c99ff0355cbe22c4e6af-2400x1256.png&w=3840&q=75)
If you’re building a full-stack app, chances are you’ll want some of your users to pay you for the service you provide. How to use Stripe with Convex to get it done.
![Michal Srb's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe8231f5314b107688be9636bd8a855e820cbca20-512x512.png&w=3840&q=75)
Michal Srb
a year ago
![A code block showing how to generate fake data using Faker. Robot hands typing on a keyboard are visible in the background.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F9d077858474cdc6da1f39216e5f952d4193cb578-1558x876.png&w=3840&q=75)
Learn how to generate fake data for your dev deployments using the Faker library
![Nicolas Ettlin's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F1ac93a575829f65dcb9deec8565971180ec23b1b-306x306.jpg&w=3840&q=75)
Nicolas Ettlin
a year ago
![Convex sits between the browser and cloud services like Pinecone and OpenAI](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0577704ca932b097a768b7872f7abe5616bf6887-884x884.png&w=3840&q=75)
Pinecone and Convex are a good match when you're looking to build an application that leverages embeddings and also has application data.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Moving data from Typeform into Convex](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F881ecce4f45ea83910293793b07a1ec3cd6926a5-1200x628.png&w=3840&q=75)
Leverage Typeform while keeping the data in a powerful transactional application database.
![Kate Rudolph's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F58121456aeee0e1eb410d800a21e3dd5b4b2612a-200x200.jpg&w=3840&q=75)
Kate Rudolph
a year ago
![Embeddings turn text into an array of numbers](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F4e40aa260c25ec7bdde41bd26f4a2a07f41d138a-1200x628.png&w=3840&q=75)
Embeddings, why they’re useful, and how we can store and use them in Convex.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Migrating from Airtable to Convex](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fbc3e84da2244a5025bb6e2477291169fe653d2ae-1201x628.png&w=3840&q=75)
Is your project in Airtable ready for more code and less no-code? I’ve published some code to help you migrate your data into Convex.
![Kate Rudolph's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F58121456aeee0e1eb410d800a21e3dd5b4b2612a-200x200.jpg&w=3840&q=75)
Kate Rudolph
a year ago
![Convex gets Rusty with Santa](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F9cb9af98a17a3efb0f22f1390775248225122449-1920x1177.jpg&w=3840&q=75)
If you've been itching to write Convex programs in Rust, your time has come. We take the new Convex Rust crate for a spin by writing a distributed system simulation of Santa and his team working together at the North Pole. Yes, really.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
a year ago
![Writing per-table rules for per-document read/modify/insert authorization.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa90eab35e6e7e4ccf426368f95f0dd3658cc7eb4-1920x1473.png&w=3840&q=75)
Implementing row-level security on Convex as a library. Wrap access to the database with access checks written in plain old JS / TS.
![Lee Danilek's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F3c79cdc687d19f0b05080ae217ed23e00b239f79-594x603.jpg&w=3840&q=75)
Lee Danilek
a year ago
![A web of relationships](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Feeaff08d0b347cb2f22b687993672aa1a0a8a1f9-5472x3648.jpg&w=3840&q=75)
In this post we’ll look at some patterns for structuring relationships in the Convex database.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Convex provides automatic type safety from your database schema to your React app. How does it work? Hint: we use some wild TypeScript.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fa1dc8776d177bcec43ecd56b145ffc8da012e1e5-1169x1078.png&w=3840&q=75)
Convex provides automatic type safety all the way from your database schema to your React app. How does it work? Hint: we use some wild TypeScript.
![Alex Cole's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F2bae2b5c39ff0e1155897b4905218100291c4949-1461x1461.jpg&w=3840&q=75)
Alex Cole
a year ago
![Make changes without taking chances](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0c2c4e00e4625334fc09e614c46e3438274abcad-5581x3857.jpg&w=3840&q=75)
There are as many ways to migrate data as there are databases, but here’s some basic information to set the stage.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Running functions in the Convex Dashboard](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F1f20b33e01b0ad78b2a7b0ab58f61bf978d35d04-1200x697.png&w=3840&q=75)
Did you know you can use the Convex Dashboard to run functions, enter seed data, filter & delete data, upload files, and more?
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Searching for Sanity](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F35cb37bae77e4771f2d3eb430c7455dd303624de-1920x1292.jpg&w=3840&q=75)
Your document is safely stored, but search is coming up empty? Inconsistent search systems can really confuse users! Don't worry–in Convex, transactional search indexing ensures that users always get what they expect and your apps just work.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
a year ago
![Using the createModeration API to moderate code](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Ffd35ac65fbae6a2d7d2f0901555733a46a2782ab-2094x1740.png&w=3840&q=75)
In this post, we’ll look at how to use the moderation API to flag messages before sending them to Chat-GPT, and patterns for handling these errors in a full-stack React app.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Identities for ChatGPT](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc7c17c64a6f86beb126c55612b536f3638870ca9-864x505.png&w=3840&q=75)
How to store multiple personalities Convex and provide them to the chatGPT API, enabling changing personalities mid-conversation. This is a follow-up to Building a full-stack ChatGPT app.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Defining a Hono endpoint in Convex](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0e1e94b7f6b4c6abd8d45624cfefb0a293210c88-2037x1404.png&w=3840&q=75)
Adding advanced HTTP Endpoint functionality by extending Convex with Hono.
![Sarah Shader's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7047febd1fcf4e4b44d4da9f199c07d842acf23b-1365x1418.jpg&w=3840&q=75)
Sarah Shader
a year ago
![Building a fullstack chat-gpt application](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F37f210ab321a9029545ccb573f626bfb8c2e9ca7-1452x956.png&w=3840&q=75)
Let's build a full-stack chat app to talk to ChatGPT on its new API!
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Image of Roy Lichtenstein's 1963 pop art piece “Crying Girl", depicting a woman looking nervous & upset with tears in her eyes (image via WikiArt, fair use)](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F38016ece679071d53e088223fe0ce2c5eb7c7105-2000x1496.jpg&w=3840&q=75)
Reactive backends like Convex make building live-updating apps a cinch, but default behavior might be too reactive for some use cases. Not to worry! Let’s fine-tune the reactive dataflow of a Convex + React app to deliver a better UX.
![Anjana Vakil's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F26b7f9ae04ef51725d117901c29166d930328d29-1080x1080.jpg&w=3840&q=75)
Anjana Vakil
a year ago
![A prompt and response from a Discord bot powered by Convex](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F51448d8410a51a8d9e70426ea0f9286e14b9e925-772x474.jpg&w=3840&q=75)
Convex provides client libraries for storing and interacting with data, but sometimes we want a third-party app like Discord to interact with data in Convex. In this post, we use webhooks to build a simple Discord bot powered by Convex.
![Sarah Shader's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F7047febd1fcf4e4b44d4da9f199c07d842acf23b-1365x1418.jpg&w=3840&q=75)
Sarah Shader
a year ago
![A screenshot of Jest test results](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fe7fd1d84a8ae0749c7b4ba222019fe3eb723bdcc-882x582.png&w=3840&q=75)
Oftentimes during testing we want to mock out our backend so we can unit test our UI components without talking to our actual server code.
In this article, we’ll explore options for testing React components that call Convex React hooks using mocking and dependency injection. To do this, I’ve written a sample TypeScript React app using the Vitest testing framework. The patterns presented in this post are also applicable to other JavaScript apps and frameworks.
![Arnold Trakhtenberg's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F4f15f1b5bf88a631070c66706bd5b819ff6fd2d1-852x852.jpg&w=3840&q=75)
Arnold Trakhtenberg
a year ago
![Using a table to manage background jobs](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5b6431ba4ee6fb2c13b631dba78eba15c83f2414-1200x852.png&w=3840&q=75)
Implement asynchronous job patterns using a table to track progress. Fire-and-forget, cancelation, timeouts, and more.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![The Whisper app for sending encrypted secrets](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fc93c02862e1717898581643d799946d2eae15030-1200x638.jpg&w=3840&q=75)
Implementing end-to-end encryption on top of Convex to build a secret-sharing app.
![Lee Danilek's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F3c79cdc687d19f0b05080ae217ed23e00b239f79-594x603.jpg&w=3840&q=75)
Lee Danilek
a year ago
![Friends don't make friends log in](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8e4e94e9451b9e1659ceca80dd5f7f57eab55e95-1200x670.png&w=3840&q=75)
Getting users to sign up for a new service before seeing any benefits is challenging. In this post, we looked at a couple of strategies for managing user information without requiring a login.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![A chat app with images generated by OpenAI](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F247fc9220e860492c0b2bffa42f00f36839b1932-2400x1276.png&w=3840&q=75)
Use Convex to fetch an image from OpenAI’s image generation service based on a user-provided prompt.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![People discussing art: what was the Dall-E prompt?](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Ffe979dabfeeccb9baf52d9bfcddbe07427068df0-1200x630.jpg&w=3840&q=75)
Building multiplayer games requires a lot of synchronization logic and event systems. However, using Convex, we get a lot of this for free! Follow along here as we build a complex multiplayer game on Convex, leveraging its reactive-by-default queries, transactional mutations, backend storage, and scheduled functions.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![It's not you, it's SQL](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5617377944cda1bd61a183edb29d14cbbbe6450a-5760x3840.jpg&w=3840&q=75)
SQL has been a part of computing for a very long time, and SQL-based database systems underly most of the world's applications. But recently, developers have been clamoring for something better, and it's time to move on.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
a year ago
![Store per-session data in Convex](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fd88710666eaa61506b696ba7bf59416e1b149858-4446x3334.jpg&w=3840&q=75)
An approach to server-persisted session data with Convex, wrapping your server functions and storing a session ID on the client.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
a year ago
![Convex loves zod](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8e2010604289193a42bdd00ec1a48d7f0d746d27-1200x628.jpg&w=3840&q=75)
Function validation is important for a production app because you can’t always control which clients are talking to your server. See how to use zod to validate your Convex functions, using our withZod wrapper.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 years ago
![The Edge](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F6197d11250ac102dd72454ac366a5c54f211fb71-1000x563.jpg&w=3840&q=75)
Convex middleware serves many purposes. Sometimes authentication, sometimes i18n. This time? Making sense (or nonsense) of emerging technology industry trends.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 years ago
![Layers. Photo by Hasan Almasi: @hasanalmasi on Unsplash](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F656924fff89ee5c82694a382bac01d90d5f804a8-5184x3456.jpg&w=3840&q=75)
Using wrapper functions like withUser can help you organize your code into middleware-like blocks that you can compose to keep your function logic concise.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 years ago
![A happy goat is one that gets votes](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0762708c09d1e8351ea6f03d10c8f417f7267819-6000x4000.jpg&w=3840&q=75)
Implementing an "upvote" feature 4 ways with Convex.
![Kate Rudolph's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F58121456aeee0e1eb410d800a21e3dd5b4b2612a-200x200.jpg&w=3840&q=75)
Kate Rudolph
2 years ago
![Feel connected to your team by adding presence to your site](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Ff911b37cad0a64866ccf44790dcf0fe60fc6bf7b-1200x628.png&w=3840&q=75)
Some patterns for incorporating presence into a web app leveraging Convex, and sharing some tips & utilities I built along the way.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 years ago
![Dare to resist weak platform guarantees. A.C.I.D. in the style of a D.A.R.E. logo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fcfc8e5358525a381f6ff40282d2fa8b2c8249c5a-1920x1080.png&w=3840&q=75)
When your database supports ACID semantics, you're free to write code the intuitive way and ignore the complexities of concurrency and failure.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 years ago
![An application field live-updating in the application table and application review page](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F935d526c1a09cb72cb018aa53e58372177f73bca-960x540.gif&w=3840&q=75)
Working with Convex has made our development workflow so much more streamlined—we no longer have to worry about the complexities of traditional frontend-backend communication, enabling us to build out the core of our new application portal at a blazing-fast speed.
![Web Development at Berkeley's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F206a96de934222cac427842592e36b401d7aadaf-200x200.jpg&w=3840&q=75)
Web Development at Berkeley
2 years ago
![Reactive Pagination automatically updates the page when inserting a new element.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F57b57b03e03e039076649498730317dc55f3284c-1200x675.gif&w=3840&q=75)
Paginating over large datasets is tricky when the data is changing. Naive approaches result in missing or duplicated data. The trick is to rewrite limit queries (fetch 5 items) into range queries (fetch between cursors). Convex handles this automatically!
![Alex Cole's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F2bae2b5c39ff0e1155897b4905218100291c4949-1461x1461.jpg&w=3840&q=75)
Alex Cole
2 years ago
![Two planes with colored exhaust trails](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F5ee45c9d7492047b2826076fe48663985fbed2c2-4286x2857.jpg&w=3840&q=75)
For write-heavy applications, use single flighting to dynamically throttle requests. See how we implement this with React hooks for Convex.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 years ago
![Movie clap board](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F4813854f2c88cba6ceef2b182322e68d13be7eb1-2000x667.png&w=3840&q=75)
Convex 0.5.0 introduces built-in support for actions — arbitrary lambda functions that run in a Node.js environment on the Convex cloud. We use the term action to differentiate these functions from Convex mutation and query functions, which enable transactional writes and dynamic subscriptions that update whenever data changes.
![James Cowling's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0d9c8f867a3ecac0ce8efe417583dbab8ce458b3-400x400.jpg&w=3840&q=75)
James Cowling
2 years ago
![An iron gate](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F3f7bf8173d6e1188d3453af1fabff01aa7e934b9-2483x3386.jpg&w=3840&q=75)
Today we’re going to talk about how to flip features on and off remotely using a clever use of the reactive nature of Convex queries.
![Ian Macartney's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F077753b63476b77fb111ba06d1bb538517033a54-3500x3500.jpg&w=3840&q=75)
Ian Macartney
2 years ago
![A toy train approaches a gap in the track](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F96c50a0c44224bf2ae68b40c5aa052b73af778a5-2000x685.jpg&w=3840&q=75)
The serverless movement has eliminated so many problems but it has left application developers with the hardest one of all: managing distributed state.
![James Cowling's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0d9c8f867a3ecac0ce8efe417583dbab8ce458b3-400x400.jpg&w=3840&q=75)
James Cowling
2 years ago
![An open drawer in a card file](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F912444784e0e2db78bd61a248b855fefba2e0169-2000x1333.jpg&w=3840&q=75)
How do I ensure my Convex database queries are fast and efficient? When should I define an index? What is an index?
This document explains how you should think about query performance in Convex by describing a simplified model of how queries and indexes function.
![Alex Cole's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F2bae2b5c39ff0e1155897b4905218100291c4949-1461x1461.jpg&w=3840&q=75)
Alex Cole
2 years ago
![Fast 5 logo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8bf79ca1e4043eeb0845501c5bddf70df4f31a87-1202x626.png&w=3840&q=75)
Why does anything really need to run on the server anymore? And even if it does, do I, the developer, need to be so involved?
Yes! Even in a serverless world, the backend computing context being a real, discrete environment that you have control and influence over is not only necessary but hugely beneficial.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 years ago
![Chart depicting 'complexity of your app' on the x-axis and 'complexity of using Convex' on the y-axis. The line is horizontal.](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Ff7e6e21cea55dea6b8016fb813fa264044585599-906x566.png&w=3840&q=75)
You don’t have to worry about the platform locking you into a decision that seems convenient at first but is a headache to deal with later.
![Indy Khare's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F79a98842e44366073f00c01658ae87ce82ab2e57-829x827.jpg&w=3840&q=75)
Indy Khare
2 years ago
![Fast 5 logo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8bf79ca1e4043eeb0845501c5bddf70df4f31a87-1202x626.png&w=3840&q=75)
While making Fast5, Convex's wordle-style multiplayer racing game, we ran into several interesting challenges. This week, let's dig into managing the combination of local and global state.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 years ago
![Fast 5 logo](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F8bf79ca1e4043eeb0845501c5bddf70df4f31a87-1202x626.png&w=3840&q=75)
At Convex, we're creating a platform for managing global state for web developers. Unsurprisingly, we've found one of the best ways to improve our platform is to actually build stuff with it!
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 years ago
![Convex and PostgreSQL logos](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F662c466f256b7ff12e568a72d84f09f970856eac-699x700.png&w=3840&q=75)
Relational databases are powerful tools for persisting data, but using them to build interactive web apps requires a lot of work. A web app architecture built on a relational database is an entire cluster of databases, backends, caching nodes, and Pub/Sub servers. And even after you invest in all of that infrastructure you'll still need to explicitly define your database schema upfront and write cumbersome SQL queries.
At Convex we believe that web developers shouldn't have to worry about any of this. We can handle the servers, caching, and reactivity and you can focus on your product.
![Alex Cole's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F2bae2b5c39ff0e1155897b4905218100291c4949-1461x1461.jpg&w=3840&q=75)
Alex Cole
2 years ago
![Convex and Firebase logos](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fd06e96e6af155a60b8b85888e6b0aa7cfd462e84-701x701.png&w=3840&q=75)
On Cloud Firestore, you'll have to do some acrobatics to integrate with React and listen for realtime updates. Down the road, you'll find your app full of slow loading experiences from request waterfalls and your database full of half-committed mutations.
![Alex Cole's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F2bae2b5c39ff0e1155897b4905218100291c4949-1461x1461.jpg&w=3840&q=75)
Alex Cole
2 years ago
![Visualization of many different data points](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2F0006787327bb6da0dacced250a7e6cebf1ad5ac2-1200x628.jpg&w=3840&q=75)
Ideas around immutability, purity, and dataflow programming are quietly saturating our technologies like Bitcoin and React. And while these early inroads are enabling exciting new ways to build large and dependable applications, there is still much to do to realize the full potential of this revolution.
![Jamie Turner's Profile image](/_next/image?url=https%3A%2F%2Fcdn.sanity.io%2Fimages%2Fts10onj4%2Fproduction%2Fee80addc4a0315dc3175c4a08f64f8bc294568bd-400x400.jpg&w=3840&q=75)
Jamie Turner
2 years ago