DEV Community

Alex Spinov
Alex Spinov

Posted on

Turso Has a Free API You Should Know About

Turso is an edge database built on libSQL (a fork of SQLite). It gives you SQLite's simplicity with the scalability of a distributed database — replicas in 30+ locations worldwide.

Why Turso Matters

A developer running a global SaaS app had 200ms database latency for users in Asia because their PostgreSQL instance was in US-East. With Turso, they added edge replicas and latency dropped to 5ms everywhere.

Key Features:

  • Edge Replicas — Database replicas in 30+ global locations
  • SQLite Compatible — Use any SQLite client library
  • Embedded Replicas — Sync database directly into your app
  • Branching — Git-like branching for databases
  • Free Tier — 9GB storage, 500 databases, 25M row reads/month

Quick Start

brew install tursodatabase/tap/turso
turso auth signup
turso db create my-app
Enter fullscreen mode Exit fullscreen mode

JavaScript SDK

import { createClient } from "@libsql/client"

const db = createClient({
  url: "libsql://my-app-username.turso.io",
  authToken: "your-token"
})

const result = await db.execute("SELECT * FROM users WHERE active = 1")
console.log(result.rows)
Enter fullscreen mode Exit fullscreen mode

Embedded Replicas

const db = createClient({
  url: "file:local-replica.db",
  syncUrl: "libsql://my-app-username.turso.io",
  authToken: "your-token"
})

await db.sync() // Sync from remote
const result = await db.execute("SELECT * FROM users") // Read locally — 0ms latency
Enter fullscreen mode Exit fullscreen mode

Why Choose Turso

  1. Global low-latency — edge replicas near every user
  2. SQLite simplicity — no complex query language to learn
  3. Generous free tier — prototype and launch without costs
  4. Works with Drizzle, Prisma, Kysely — integrates with your ORM

Check out Turso docs to get started.


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

Top comments (0)