Let's build a database!
Is Convex just a Postgres wrapper? I still see this question come up on Discord and X, and to some degree I can understand the confusion. So in this one we build a database from scratch with the same properties as Convex. We start with a single JSON file and keep fixing whatever breaks, until we've got transactions, a committer, a transaction log, indexes, reactive queries and a scheduler. Then at the end we crack open the SQLite file and look at what Convex actually stores in it, and what it puts in Postgres when you run it on that instead. So if you've been wondering how Convex compares to Postgres, or you just fancy building your own database from scratch, grab yourself a lovely cup of tea and let's dive in. Every demo in this video is live on the page, so you can have a poke at them yourself: https://explained.convex.dev/build-your-own-convex/ This is the first Convex Explained article and it's a new format for me, so I'd love to know if it works for you. Which demo made it click for you, and which one lost you? Let me know down in the comments. Chapters 0:00 Is Convex just a Postgres wrapper? 1:14 01 A database in a JSON file 2:44 02 Why we append instead of edit 5:39 03 Transactions: surviving a power cut 8:25 04 Mutations and the double-sold hat 13:34 05 The committer: read sets and write sets 19:42 06 Nothing changed... since when? 22:05 07 Indexes, and why they need versions 27:53 08 Queries and subscriptions 30:22 09 Actions and the scheduler 33:25 10 Everything working together 35:10 The verdict: what Convex puts in Postgres 36:30 Does this format work for you?