How It Works
Quick Start
1
Get Turso Credentials
- Install Turso CLI:
curl -sSfL https://get.tur.so/install.sh | bash - Create database:
turso db create mydb - Get credentials:
2
Create Edge Agent
3
Test Edge Performance
Installation
- pip
- Environment Variables
Connection Modes
Embedded Replica (Recommended)
Local SQLite file syncs with remote Turso server:Remote Only
Direct connection to Turso edge:Local Only
Pure local SQLite for development:Configuration Options
Usage Patterns
Using Convenience Class
Multi-Region Setup
Full Lifecycle with Edge Performance
Turso-Specific Features
Manual Sync Control
Control when local replica syncs to remote:Database Scaling
Turso automatically scales to handle traffic:Global Replication
Create replicas in multiple regions:Best Practices
Optimize for Edge Performance
Optimize for Edge Performance
Use embedded replicas for fastest reads:
Handle Network Partitions
Handle Network Partitions
Embedded replicas continue working during network outages:
Monitor Replica Size
Monitor Replica Size
Local replicas grow with conversation history:
Use Multiple Databases
Use Multiple Databases
Separate different data types for optimal performance:
Environment Variables
Performance Comparison
Troubleshooting
Sync Failures
If replica sync fails:Token Expiration
Turso tokens can expire. Regenerate them:Replica File Permissions
Ensure local replica file is writable:Related
Cloud Databases Overview
Compare all cloud database providers
Local SQLite
Pure local SQLite for development

