Database
/SQLite Storage
SQLite Storage
SQLite provides file-based persistence with ACID compliance, making it perfect for development, testing, and small-scale applications. However, it's not recommended for production use due to concurrency limitations.
Overview
SQLite is a self-contained, file-based database that doesn't require a separate server process. Open LangGraph Server uses SQLite as the default persistent storage when no other databases are configured.
Characteristics
- š File-based - Simple setup with no server required
- āļø ACID compliant - Reliable transactions
- š Good performance - Fast for moderate workloads
- š Single-writer - Best for single-instance deployments
Configuration
Setup
Basic Setup
Directory Structure
Schema
Open LangGraph Server automatically creates the following tables:
checkpoints- Graph state persistencecheckpoint_writes- Checkpoint write operationsthreads- Thread metadata and status
Use Cases
Perfect for:
- Development environments - Easy setup without external dependencies
- Automated testing - Fast, isolated test execution
- Prototyping and demos - Quick proof-of-concepts
- Small personal projects - Simple file-based persistence
- Learning and experimentation - Understanding LangGraph without complex setup
Not recommended for:
- Production applications - Single-writer limitation affects concurrency
- Multi-server deployments - Cannot share data across instances
- High-traffic applications - Performance degrades under heavy load
- Enterprise environments - Lacks advanced features like replication
Backup Strategy
Simple Backup Script
Automated Backups
Performance Characteristics
| Metric | SQLite Performance |
|---|---|
Read Latency | 0.1-1ms |
Write Latency | 1-5ms |
Concurrent Connections | 1 writer + multiple readers |
Max Database Size | 281 TB (theoretical) |
Memory Usage | 256KB - 2GB (configurable) |
Limitations
Concurrency
- Single writer limitation - Only one write operation at a time
- WAL mode helps - Allows concurrent reads during writes
- Not suitable for high-write workloads
Scalability
- Single file - Cannot distribute across multiple servers
- File system limits - Subject to OS file system constraints
- Network storage - Not recommended for network-mounted storage
Recovery Procedures
WAL Recovery
Database Repair
Best Practices
Development
- Use SQLite for local development and prototyping
- Enable WAL mode for better concurrency during development
- Set appropriate cache size for your development workload
- Use separate database files for different environments
Testing
- Perfect for unit tests and integration tests
- Each test can use a fresh database file
- Fast setup and teardown
- No external dependencies required
When to Switch
SQLite is great for development, but consider switching to PostgreSQL or Redis when:
- Multiple servers: Need to share data across instances
- High concurrency: Many simultaneous users/connections
- Advanced features: Complex queries, replication, or enterprise features
- Production deployment: Need enterprise-grade reliability
Migration Path
When ready to scale beyond SQLite:
- PostgreSQL: For ACID compliance and concurrent access
- Redis: For high-performance caching and TTL management
- Hybrid: PostgreSQL for persistence + Redis for performance
Built with
Show your support! Star us on GitHub āļø