Database

Merging Streams of Convex data
New convex-helpers are available now for fetching streams of documents, merging them together, filtering them them out, and paginating the results. With these helpers, you can replicate patterns you may know from SQL: UNION ALL, JOIN, DISTINCT, GROUP BY, and WHERE clauses where index fields are skipped.
Lee Danilek's avatar
Lee Danilek
6 days ago
Translate SQL into Convex Queries
Here’s a cheatsheet with examples of conversions between SQL queries and Convex queries. This article is geared towards developers (and LLMs) who have familiarity with SQL and want to translate those familiar patterns into Convex queries. You'll learn how to `UNION`, `JOIN`, `DISTINCT`, do `WHERE` clauses, and `SELECT` fields.
Lee Danilek's avatar
Lee Danilek
8 days ago
MongoDB to Convex: A Step-by-Step Data Migration Script
Moving data between databases is never fun, but I needed to get 2 million MongoDB documents into Convex without losing my mind. This post walks through my migration script, covering everything from connecting databases to handling schema changes, batch processing, and error handling. If you’re thinking about moving from MongoDB to Convex, consider this your survival guide—coffee highly recommended!
Bobby Alv's avatar
Bobby Alv
17 days ago
Optimize Transaction Throughput: 3 Patterns for Scaling with Convex and ACID Databases
Explore techniques to improve transaction throughput and concurrency in ACID databases by reducing conflicts and optimizing database reads. This guide covers patterns like Queue, Hot and Cold Tables, and Predicate Locking with clear examples using Convex, providing developers with tools to handle high-throughput workflows effectively.
Lee Danilek's avatar
Lee Danilek
2 months ago
Convex Cookbook: Dynamic Query Builders
You can write a Convex query whose structure -- which index/order/filters to apply, if any -- depends on runtime factors. This article gives a recipe for building queries dynamically.
Lee Danilek's avatar
Lee Danilek
3 months ago
Database Triggers
Triggers automatically run code whenever data in a table changes. A library in the convex-helpers npm package allows you to attach trigger functions to your Convex database.
Lee Danilek's avatar
Lee Danilek
6 months ago
SELECT DISTINCT without SQL
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 avatar
Nipunn Koorapati
10 months ago
Stateful Online Migrations using Mutations
Online migrations in Convex using mutations, including a Convex Component to manage them.
Ian Macartney's avatar
Ian Macartney
a year ago