Overview
Turso is an edge database service that provides a distributed, SQLite-compatible data layer. Founded in 2022, it is engineered to support applications requiring low-latency data access, particularly those deployed in serverless and edge computing environments. Turso extends the capabilities of SQLite by offering a managed service that synchronizes data across a global network of replicas, bringing data closer to end-users and application instances Turso overview documentation. This architecture aims to minimize network latency for database operations, which is critical for interactive web applications and APIs.
The service targets developers building applications where data locality and responsiveness are paramount. This includes use cases such as real-time dashboards, collaborative applications, content delivery networks, and global APIs. By leveraging SQLite as its foundational data model, Turso offers a familiar relational database interface, enabling developers to use existing SQL knowledge and tools. The platform provides a command-line interface (CLI) for database management and a libSQL client library, which is a fork of SQLite, offering a consistent API across various programming languages Turso API reference. This focus on SQLite compatibility simplifies migration for projects already using SQLite or provides a lightweight relational option for new projects.
Turso's operational model emphasizes ease of deployment and scalability for edge workloads. Databases can be provisioned and managed globally, with data replication handled by the service. This allows applications to read and write data from the nearest available replica, improving performance for geographically dispersed users. The platform supports database branching, a feature that enables developers to create isolated copies of a database for development, testing, or feature-specific deployments without affecting production data. This capability aligns with modern CI/CD workflows and facilitates rapid iteration on database schemas and application logic. Turso offers a free Starter tier, allowing developers to experiment with the service before committing to paid plans.
While Turso focuses on edge deployments, other database providers like Neon also offer serverless PostgreSQL with branching capabilities, illustrating a trend towards more flexible and distributed database architectures for cloud-native applications Neon serverless PostgreSQL overview. Turso's distinction lies in its specific focus on SQLite compatibility and its architecture optimized for low-latency edge access, which can be particularly advantageous for applications where a lightweight, embedded-database-like experience is desired but with the benefits of a managed, distributed service.
Key features
- Edge Deployment: Distributes database replicas globally to reduce read and write latency for end-users, optimizing performance for geographically dispersed applications Turso architecture details.
- SQLite Compatibility: Utilizes
libSQL, a fork of SQLite, ensuring compatibility with existing SQLite tools and SQL queries, simplifying migration and development. - Serverless Integration: Designed to integrate with serverless functions and platforms, providing a low-latency data layer for event-driven architectures.
- Database Branching: Enables the creation of isolated database branches for development, testing, and staging environments, facilitating parallel development and safe experimentation.
- CLI and SDKs: Provides a command-line interface for database management and client libraries (SDKs) for JavaScript/TypeScript, Go, Python, Rust, Ruby, Elixir, C#, and Java for programmatic interaction Turso client libraries.
- Built-in Replication: Manages automatic data replication and synchronization across edge locations to maintain consistency and availability.
- Managed Service: Handles infrastructure, scaling, and maintenance of the database instances, allowing developers to focus on application logic.
- GDPR Compliance: Adheres to General Data Protection Regulation (GDPR) standards for data privacy and security.
Pricing
Turso offers a free tier and various paid plans with usage-based billing. Pricing information is current as of 2026-06-12 Turso pricing page.
| Plan | Monthly Cost | Reads | Writes | Storage | Databases | Branches per DB |
|---|---|---|---|---|---|---|
| Starter (Free) | $0 | 1 billion rows | 100 million rows | 1 GB per DB | 10 | 3 |
| Developer | $29 | 2 billion rows | 200 million rows | 2 GB per DB | 20 | 5 |
| Team | $99 | 5 billion rows | 500 million rows | 5 GB per DB | 50 | 10 |
| Enterprise | Custom | Custom | Custom | Custom | Custom | Custom |
Paid plans include additional usage-based billing for reads, writes, storage, and database instances beyond the included allowances.
Common integrations
- Vercel: Deploy serverless functions and web applications with Turso as the backend database. Vercel database integrations documentation.
- Netlify Functions: Connect Turso databases to Netlify serverless functions for dynamic content and API backends. Netlify Functions overview.
- Cloudflare Workers: Utilize Turso as a low-latency database for applications deployed on Cloudflare's edge computing platform. Cloudflare Workers documentation.
- Fly.io: Integrate with Fly.io applications for global deployments and edge data access. Fly.io application configuration.
- Next.js: Use Turso with Next.js applications for data persistence, especially with server components and API routes. Next.js data fetching documentation.
Alternatives
- PlanetScale: A serverless MySQL-compatible database with database branching and a focus on developer experience.
- Neon: A serverless PostgreSQL database with a focus on developer experience, including branching and a separation of storage and compute.
- Supabase: An open-source Firebase alternative providing PostgreSQL databases, authentication, real-time subscriptions, and storage.
Getting started
To get started with Turso, you typically install the Turso CLI, create a database, and then connect to it using one of the available client libraries. Here's a basic example using the JavaScript/TypeScript SDK to connect to a Turso database and perform a simple query.
First, ensure you have Node.js and npm installed. Then, install the Turso CLI and the @libsql/client package:
npm install -g @libsql/cli
npm install @libsql/client
Next, create a Turso database using the CLI:
turso db create my-turso-db
This command will output connection details, including the database URL and an authentication token. You'll need these to connect from your application.
Now, create a JavaScript file (e.g., index.js) and add the following code, replacing the placeholder values with your actual database URL and token:
import { createClient } from "@libsql/client";
const client = createClient({
url: process.env.TURSO_DATABASE_URL,
authToken: process.env.TURSO_AUTH_TOKEN,
});
async function runExample() {
try {
// Create a table if it doesn't exist
await client.execute(
"CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)"
);
console.log("Table 'users' ensured to exist.");
// Insert data
const insertResult = await client.execute(
`INSERT INTO users (name) VALUES ('Alice')`
);
console.log(`Inserted user: ${insertResult.rowsAffected} row(s) affected.`);
// Query data
const { rows } = await client.execute("SELECT * FROM users");
console.log("Users:", rows);
// Update data
const updateResult = await client.execute(
"UPDATE users SET name = 'Alicia' WHERE name = 'Alice'"
);
console.log(`Updated user: ${updateResult.rowsAffected} row(s) affected.`);
// Query updated data
const { rows: updatedRows } = await client.execute("SELECT * FROM users");
console.log("Updated Users:", updatedRows);
} catch (e) {
console.error("Error running example:", e);
}
}
runExample();
Before running the script, set your environment variables for the database URL and token:
export TURSO_DATABASE_URL="your_turso_database_url"
export TURSO_AUTH_TOKEN="your_turso_auth_token"
node index.js
This script will connect to your Turso database, create a users table if it doesn't exist, insert a user, query all users, update a user, and then query the updated list. This demonstrates the basic CRUD operations with Turso using the JavaScript SDK.