Overview
SQLite is a library, not a server. It links into your application and reads and writes a single file, which is why it ships inside your phone, your browser, and half the CLIs on your machine. The catch has always been the same: one file on one disk. Wonderful for local development, awkward for anything that has to run close to users in more than one region.
Turso tries to close that gap with remote access over HTTP, local replicas that sync from a primary, vector columns, and a hosted platform. The pitch is simple. The name isn’t. “Turso” points at two different database engines and a hosting product, and the first line turso dev printed on my machine was sqld listening on port 8080. That’s the older engine.
This post sorts out which is which, then tests the feature where the difference matters most: what a local replica sees after another connection writes to the primary.
Two engines and a hosted service
Start with the original project. The company behind Turso forked SQLite in C and called the fork libSQL. Its server, sqld, accepts remote SQL connections and supports embedded replicas, and it gave Turso its early features. It’s stable, and it’s done growing: the team still maintains it, but new features land elsewhere. The latest sqld release is still 0.24.32.
Elsewhere is Turso Database, a SQLite-compatible rewrite in Rust that started as a side project called Limbo and later took the Turso name. It isn’t a fork. It’s a new implementation from the file format up, it hasn’t reached 1.0, and it ships fast (the latest stable release at the time of writing is 0.8.4). That renaming isn’t a coincidence. It’s closer to a company deciding its old fork was the wrong long-term bet, quietly starting over, and handing the new thing the brand it had already built.
Then there’s Turso Cloud, the hosted service, which markets itself simply as “Turso”. Its Go driver reference lists drivers by engine and connection type. go-libsql gives an existing libSQL application embedded replicas. tursogo embeds the Rust engine and supports Turso Sync. So when someone says “we’re using Turso”, ask which one. If you inherit the service, the imports and the server it talks to will tell you.
Start the local libSQL server
Install the Turso Cloud CLI and open an empty directory. Check both versions before anything else. The first is the CLI. The second is the engine it actually starts.
turso --version
# turso version v1.0.30
turso dev --version
# sqld sqld 0.24.32 (40c272de 2025-02-14)
turso dev --db-file local.dbThe demo connects to the dev server at 127.0.0.1:8080. Leave it running and open a second shell in the same directory.
The example below uses the JavaScript client. go-libsql would be the natural choice for a Go service, but it ships a prebuilt native library, and on Apple Silicon with Go 1.27 the build failed before it ever made a connection. If your team is on Go, check that it builds on every platform you develop on before you commit to it.
Read before and after sync
Pin the client version so the output matches.
npm init -y
npm install --save-exact @libsql/client@0.17.2Save the following as replica.mjs. The primary client sends SQL to the server. The replica reads from a local file and contacts the server when it syncs. The program seeds one row and syncs it to disk. Then the primary connection corrects the title.
import { createClient } from "@libsql/client";
const primaryUrl = "http://127.0.0.1:8080";
const primary = createClient({ url: primaryUrl });
const replica = createClient({ url: "file:replica.db", syncUrl: primaryUrl });
async function readTitle() {
const result = await replica.execute("SELECT title FROM songs WHERE id = 1");
return result.rows[0].title;
}
try {
await primary.execute("CREATE TABLE songs (id INTEGER PRIMARY KEY, title TEXT NOT NULL)");
await primary.execute("INSERT INTO songs VALUES (1, 'Gymnopedie No. 1')");
await replica.sync();
await primary.execute("UPDATE songs SET title = 'Gymnopédie No. 1' WHERE id = 1");
console.log("Before sync:", await readTitle());
await replica.sync();
console.log("After sync: ", await readTitle());
} finally {
replica.close();
primary.close();
}Run node replica.mjs once against the fresh dev server. The same query returns two different spellings.
Before sync: Gymnopedie No. 1
After sync: Gymnopédie No. 1The primary accepted the UPDATE before either SELECT ran. The first SELECT still returned the old title because it read the replica on disk, and the replica hadn’t synced yet. That gap is what bites when a background job writes through one connection and a user expects a replica-backed page to show the change immediately. The two connections matter here. A write through the replica’s own client can trigger its read-your-writes behavior, which hides the gap in a quick test.
Check the vector index
The local server also lets you try libSQL’s vector index. Paste the following into the SQL shell opened with turso db shell http://127.0.0.1:8080.
CREATE TABLE docs (id INTEGER PRIMARY KEY, title TEXT, embedding F32_BLOB(4));
INSERT INTO docs VALUES (1, 'sqlite basics', vector('[0.9,0.1,0.0,0.0]'));
INSERT INTO docs VALUES (2, 'turso embedded replicas', vector('[0.85,0.15,0.05,0.0]'));
INSERT INTO docs VALUES (3, 'baking sourdough bread', vector('[0.0,0.0,0.1,0.95]'));
CREATE INDEX docs_embedding_idx ON docs (libsql_vector_idx(embedding));
SELECT id FROM vector_top_k('docs_embedding_idx', vector('[0.9,0.1,0.0,0.0]'), 2);The index returned IDs 1 and 2, the two database-related rows. Three hand-picked vectors tell me that the SQL path works locally. I’d need a real corpus to say anything about recall or speed.
Summary
I would still use turso dev to reproduce an issue against a libSQL server. For an app that has to take writes while disconnected, I would test Turso Sync with its own local sync server. The Rust-based client writes to the local file first, then pushes and pulls explicitly. If two devices change the same row while offline, the order in which they push can determine which edit survives. That deserves its own test, with the engine you will actually ship.
Leave a comment