What you can build with Sirannon

SQLite already sits inside your process; Sirannon gives it the parts a service needs. These are the five jobs it's built for, each linked to the guide showing the code.

One API across every JavaScript runtime

Sirannon separates the database engine from the library, so you choose a driver and keep the same query API. Run better-sqlite3 or Node's built-in SQLite on the server, wa-sqlite with IndexedDB in the browser, bun:sqlite on Bun, and expo-sqlite on React Native, all through one interface.

Read the getting started guide
database.tsTypeScript
1import { Database } from '@delali/sirannon-db'
2import { betterSqlite3 } from '.../driver/better-sqlite3' // swap this line per runtime
3const driver = betterSqlite3()
4const db = await Database.create('app', './app.db', driver)
5await db.query('SELECT * FROM users')
Node.jsbetter-sqlite3Browser · Bun · React Native

Transactions and concurrent reads

Wrap several statements in a transaction and they commit together or roll back together, with full ACID guarantees. Every database opens one dedicated write connection and a pool of readers, four by default, and WAL mode lets those reads run while a write is in progress, so a busy write path never blocks your queries.

Read the queries and transactions guide
accounts Filter Sort
idint8holder textbalance int8
1Emma Wright4,000
2Kenji Tanaka3,000
3Sofia Rossi8,500
Transaction committed1 writer · 4 readers · WAL

Bulk writes for imports and backfills

Run one statement over many parameter sets as an atomic batch, or import a large dataset with bulkLoad, which runs the whole load in one transaction under relaxed durability and restores your configured level when it finishes. A big import then pays one durability barrier instead of one per row, and both paths run in process or over the server on HTTP and WebSocket.

Read the bulk load guide
import-events.tsTypeScript
1await db.bulkLoad(
2 'INSERT INTO events (id, payload) VALUES (?, ?)',
3 rows,
4 { durability: 'off' },
5)
250,000 rows loaded in one transaction

durability off during load, restored to normal

Real-time features on plain SQLite

Change data capture tracks inserts, updates, and deletes through triggers as they commit, and clients subscribe to table changes over WebSocket. Activity feeds, live dashboards, and cache invalidation come from the database itself instead of a separate message bus.

Read the change data capture guide
Change feedorders, cartsLive
4194deletecarts#92212:04:07
4193updateorders#1837 → paid12:04:05
4192insertorders#1841 → pending12:04:04
WebSocketSubscriptions restore on reconnect

One database per tenant

SQLite makes a database per customer cheap, and Sirannon makes it manageable. Instance lifecycle management provisions databases on demand, enforces idle timeouts, and evicts by least recent use, so the pool stays bounded as tenants accumulate.

Read the lifecycle guide
Instancesone DB per tenant

brightwood-legal

data/brightwood-legal.db

4 connsActive

patel-associates

data/patel-associates.db

12 minIdle

volta-tours

data/volta-tours.db

freedEvicted
Provisioned on demandLRU eviction

Read scaling with proven failover

One primary accepts writes and replicates HLC-stamped change batches to read replicas over gRPC. Coordinator mode adds etcd-backed authority with primary terms, in-sync sets, and majority write concern, and it fails closed for writes when it can't prove a safe primary.

Read the replication guide
Clustercoordinator · etcd

node-a

accepts writes

leaderPrimary

node-b

read replica

0 msIn sync

node-c

read replica

240 msCatching up
etcd holds write authorityterm 7

A database your clients reach over the network

The bundled server exposes every database over HTTP and WebSocket with authentication hooks, and the client SDK mirrors the core API with automatic reconnection and subscription restore. Browser apps, serverless functions, and other services query SQLite like any networked database.

Read the client SDK guide
Client SDKConnected
Endpointwss://db.brightwood.app
TransportWebSocket
Round-trip18 ms
Subscriptionsorders, carts
Reconnectedsubscriptions restored

Migrations, backups, and hardening

Versioned migrations run up and down from SQL files, scheduled snapshot backups rotate automatically, and the core enforces parameterised queries, identifier validation, and path traversal prevention.

Read the migrations guide
Migrations1 pending
0001_init.sqlApplied
0002_add_orders.sqlApplied
0003_add_indexes.sqlPending
Snapshot backupnightly · keep 7
Versioned up and downidentifier + path checks

Try Sirannon on your own data

The documentation covers everything above in depth, starting with the getting started guide.