sikiodb
v0.1.1
Published
A blazing-fast, local-first database for the web. Up to 2.5x - 3x faster than IndexedDB. Built with Rust, WebAssembly, and OPFS.
Maintainers
Readme
SikioDB
A blazing-fast, local-first database for the web. Built with Rust, WebAssembly, and OPFS.
Performance
| Records | IndexedDB | SikioDB | Speedup | |---------|-----------|---------|---------| | 10,000 | 220 ms | 81 ms | 2.70x | | 100,000 | 2,339 ms | 972 ms | 2.41x | | 1,000,000 | 31,759 ms | 10,761 ms | 2.95x |
Benchmarks: 100 runs average (10K/100K), 5 runs average (1M)
Features
- OPFS Storage — Direct file system access, no IndexedDB overhead
- LZ4 Compression — Automatic data compression
- B-Tree Index — Efficient key-value lookups
- WAL — Write-ahead logging for durability
- ACID Transactions — Atomic commits with rollback
- Multi-Tab Sync — Leader election via Web Locks API
- Query Builder — SQL-like filtering, sorting, pagination
- TTL Support — Auto-expiring keys
- Subscriptions — Real-time change notifications
Installation
npm i sikiodbor
yarn add sikiodbQuick Start
import { SikioDB } from 'sikiodb';
const db = await SikioDB.open('myapp');
// basic operations
await db.put('user:1', JSON.stringify({ name: 'Alice', age: 25 }));
const user = await db.get('user:1');
await db.delete('user:1');
// transactions (atomic)
await db.transaction(tx => {
tx.put('order:1', 'pending');
tx.put('order:2', 'pending');
tx.delete('cart:1');
});
// query api
const adults = await db.query('users')
.where('age', '>=', 18)
.orderBy('name', 'asc')
.limit(10)
.exec();
// real-time subscriptions
db.subscribe('messages', (event) => {
console.log('New data:', event.changes);
});
await db.close();Building from Source
cargo install wasm-pack
wasm-pack build --target web --releaseContributing
Found a bug or have a feature request? Open an Issue. PRs are welcome!
License
This project is licensed under AGPLv3.
If you want to use SikioDB in a proprietary (closed-source) commercial project and cannot comply with AGPL requirements, please contact me at [email protected] for a commercial license.
