
Turso Has a Free Embedded Database That Syncs Globally — SQLite at the Edge With libSQL
The Edge Database Problem Cloudflare D1 is Cloudflare-only. PlanetScale is MySQL-only. Most databases have one region — adding a read replica costs $50+/month. Turso distributes SQLite globally. Your data replicates to edge locations automatically. Based on libSQL, a fork of SQLite. What Turso Gives You Embedded Replicas import { createClient } from ' @libsql/client ' ; const db = createClient ({ url : ' file:local.db ' , syncUrl : ' libsql://your-db.turso.io ' , authToken : ' your-token ' , }); // Reads hit local SQLite file — zero latency const users = await db . execute ( ' SELECT * FROM users ' ); // Writes go to primary, then sync to replicas await db . execute ( ' INSERT INTO users (name) VALUES (?) ' , [ ' John ' ]); // Manual sync await db . sync (); Your app has a local SQLite copy. Reads are instant. Writes propagate globally. Multi-Region Replication # Create database turso db create my-app # Add replicas turso db replicate my-app --location ams # Amsterdam turso db replicat
Continue reading on Dev.to Webdev
Opens in a new tab

