[ Web Proxy ]
URL:
Viewing: https://openworkflow.dev/docs/sqlite [Back]  [Original]

SQLite Backend - OpenWorkflow
Skip to main content
Navigation
Backends
SQLite Backend
Backends

SQLite Backend

Lightweight SQLite storage for development and testing

The SQLite backend is the easiest way to get started without running an external database. Its ideal for local development, testing, and single-server deployments. When youre ready for production with multiple workers, switch to PostgreSQL. Uses bun:sqlite for Bun and node:sqlite for Node.js (requires Node.js 22.5+).

Setup

Note: BackendSqlite.connect() is synchronous (no await needed).

File Path

The database file is created if it doesnt exist:

Configuration Options

Git Ignore

Add the database file and SQLite sidecar files to .gitignore:
The CLIs init command does this automatically when you choose SQLite.

When to Use SQLite

Good for:
  • Local development
  • Testing and CI
  • Single-server deployments
  • Prototyping
  • Small-scale production with low throughput
Consider PostgreSQL for:
  • Multi-server deployments
  • High concurrency requirements
  • Production workloads with many workers
  • Environments requiring database-level backups

Concurrency

SQLite supports concurrent reads but uses locking for writes. The backend handles this with BEGIN IMMEDIATE transactions. For single-worker setups, this works well. For multiple workers, PostgreSQL is recommended.

Namespaces

Use namespaceId to isolate environments:
See Namespaces for more details.

Config File Example

For use with the CLI, create openworkflow.config.ts:

Development + Production Setup

A common pattern uses SQLite for development and PostgreSQL for production:
PostgreSQL Backend
Namespaces

Web Proxy Viewer  |  New URL  |  Original Page