All articles

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
19 days ago

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
a month ago

Let's build a full-stack chat app to talk to ChatGPT on its new API!

Ian Macartney
3 months ago

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
13 days ago

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
21 days ago

In this post, we’ll look at some helper functions to help write code to traverse relationships in a readable, predictable, and debuggable way.

Ian Macartney
a month ago

In this post we’ll look at some patterns for structuring relationships in the Convex database.

Ian Macartney
a month ago

Using mutations to migrate data in Convex.

Ian Macartney
a month ago

There are as many ways to migrate data as there are databases, but here’s some basic information to set the stage.

Ian Macartney
a month ago

Did you know you can use the Convex Dashboard to run functions, enter seed data, filter & delete data, upload files, and more?

Ian Macartney
2 months ago

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
3 months ago

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
3 months ago

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
3 months ago

Adding advanced HTTP Endpoint functionality by extending Convex with Hono.

Sarah Shader
3 months ago

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
3 months ago

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
4 months ago

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
4 months ago

Implement asynchronous job patterns using a table to track progress. Fire-and-forget, cancelation, timeouts, and more.

Ian Macartney
4 months ago

Implementing end-to-end encryption on top of Convex to build a secret-sharing app.

Lee Danilek
4 months ago

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
4 months ago

Use Convex to fetch an image from OpenAI’s image generation service based on a user-provided prompt.

Ian Macartney
4 months ago

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
4 months ago

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
4 months ago

How to implement session storage with Convex, using some helper functions we wrote. While most of your data is associated with a user or another document, sometimes you have data that is specific to a user’s browser tab, or associated with a user who isn’t logged in. Some of this data is stored on the client, such as in the browser’s `sessionStorage` or `localStorage`, while other data is stored on the server.

Ian Macartney
4 months ago

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
4 months ago

Convex middleware serves many purposes. Sometimes authentication, sometimes i18n. This time? Making sense (or nonsense) of emerging technology industry trends.

Jamie Turner
5 months ago

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
5 months ago

Implementing an "upvote" feature 4 ways with Convex.

Kate Rudolph
5 months ago

Some patterns for incorporating presence into a web app leveraging Convex, and sharing some tips & utilities I built along the way.

Ian Macartney
5 months ago

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
6 months ago

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
6 months ago

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
6 months ago

For write-heavy applications, use single flighting to dynamically throttle requests. See how we implement this with React hooks for Convex.

Ian Macartney
6 months ago

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
6 months ago

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
6 months ago

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
7 months ago

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
a year ago

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
a year ago

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
a year ago

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
a year ago

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
a year ago

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
a year ago

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
a year ago

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
a year ago