What libSQL Does
- SQLite compatible — full SQLite API and file format
- Server mode — HTTP and WebSocket access (sqld)
- Embedded replicas — local SQLite file synced from remote
- Vector search — F32_BLOB type + vector distance functions
- ALTER TABLE — DROP COLUMN and other extensions
- Encryption — at-rest encryption
- Multi-tenancy — schema-based namespace isolation
- Edge deployment — replicas at edge locations
- TypeScript/Rust/Go/Python clients — official SDKs
- Turso managed — global edge DB service
Architecture
Fork of SQLite C codebase with extensions. sqld (server daemon) wraps libSQL and serves HTTP/WebSocket/gRPC. Embedded replicas sync WAL frames from primary to local SQLite file on the client. Turso infrastructure distributes replicas globally via Fly.io.
Self-Hosting
# Run sqld server
docker run -d --name libsql -p 8080:8080 \
-v libsql-data:/var/lib/sqld \
ghcr.io/tursodatabase/libsql-server:latest
# Connect
curl http://localhost:8080/v2/pipeline -d "{\"requests\": [{\"type\": \"execute\", \"stmt\": {\"sql\": \"SELECT 1\"}}]}"Key Features
- Full SQLite compatibility
- Server mode (HTTP + WebSocket)
- Embedded replicas
- Vector search
- ALTER TABLE extensions
- Encryption at rest
- Multi-tenancy
- Edge deployment (Turso)
- Official SDKs (TS, Rust, Go, Python)
- Open to contributions (unlike SQLite)
Comparison
| Database | Type | Server Mode | Vector |
|---|---|---|---|
| libSQL | SQLite fork | Yes (sqld) | Yes |
| SQLite | Embedded | No | No |
| LiteFS | SQLite replication | Proxy | No |
| Cloudflare D1 | SQLite managed | Yes | No |
| PlanetScale | MySQL managed | Yes | No |
| Neon | Postgres managed | Yes | Via pgvector |
FAQ
Q: Difference from SQLite? A: libSQL is a superset of SQLite. It adds a server mode, embedded replicas, vector search, and ALTER TABLE extensions. The upstream SQLite project doesn't accept external contributions; libSQL is completely open.
Q: What is Turso? A: Turso is a managed edge database service built on libSQL. Database replicas are deployed across global edge nodes (Fly.io) with read latency <50ms. Free tier offers 9GB of storage and 500 DBs per month.
Q: What scenarios is it for? A: Scenarios needing SQLite's simplicity plus remote access, multiple replicas, or vector search. Examples: SaaS multi-tenant, mobile app local cache + cloud sync, edge worker data layer.
Sources
- Docs: https://docs.turso.tech
- GitHub: https://github.com/tursodatabase/libsql
- License: MIT