DEV Community

Alex Spinov
Alex Spinov

Posted on

Turso Has a Free API — SQLite at the Edge with Embedded Replicas

What if SQLite ran at the edge — replicated globally, with embedded replicas that sync to your app automatically?

Turso is a distributed SQLite platform built on libSQL. It gives you the simplicity of SQLite with the scale of a distributed database.

Why Turso

  • Edge deployment — databases in 30+ global locations
  • Embedded replicas — sync a read replica directly into your app
  • libSQL — fork of SQLite with server-mode and extensions
  • Branching — create database branches for development
  • Compatible — works with any SQLite client/ORM
  • Free tier — 9 GB storage, 500 databases, 25 billion row reads/month

Quick Start

# Install Turso CLI
curl -sSfL https://get.tur.so/install.sh | bash
turso auth signup

# Create a database
turso db create my-app

# Get connection URL
turso db show my-app --url
turso db tokens create my-app
Enter fullscreen mode Exit fullscreen mode
import { createClient } from "@libsql/client";

const db = createClient({
  url: process.env.TURSO_URL,
  authToken: process.env.TURSO_TOKEN,
});

const result = await db.execute(
  "SELECT * FROM users WHERE active = ? ORDER BY created_at DESC LIMIT 10",
  [true]
);
Enter fullscreen mode Exit fullscreen mode

Embedded Replicas

import { createClient } from "@libsql/client";

// Embedded replica — reads from local SQLite, syncs from Turso
const db = createClient({
  url: "file:local-replica.db",
  syncUrl: process.env.TURSO_URL,
  authToken: process.env.TURSO_TOKEN,
  syncInterval: 60, // Sync every 60 seconds
});

// This read hits local SQLite — sub-millisecond, even offline
const users = await db.execute("SELECT * FROM users");
Enter fullscreen mode Exit fullscreen mode

Real Use Case

A mobile-first app had 200ms API latency for database reads. After adding Turso embedded replicas, reads dropped to <1ms — the data was in a local SQLite file synced from the edge. Users with poor connectivity could still read data offline.

When to Use Turso

  • Edge-first applications needing global data
  • Apps that benefit from offline-capable reads
  • SQLite fans who need multi-region
  • Serverless apps wanting embedded database replicas

Get Started

Visit turso.tech — free tier, 500 databases, no credit card.


Need custom data pipelines or scraping solutions? Check out my Apify actors or email me at spinov001@gmail.com for custom solutions.

Top comments (0)