Skip to content

Commit 245b2f8

Browse files
committed
Bump to v0.4.0, update README for volume-based storage, fix Linux alloca
- Update README: persistence docs for v0.4.0 volume-based engine (checkpoint_interval, sync_mode, compact_threshold, volume_compression) - Add test verifying volumes/ directory creation and PRAGMA CHECKPOINT - Fix Linux build: add #include <alloca.h> for non-Windows platforms - Format JS/TS files with prettier - Bump all versions to 0.4.0
1 parent b455e4f commit 245b2f8

File tree

13 files changed

+975
-644
lines changed

13 files changed

+975
-644
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
env:
15-
STOOLAP_ENGINE_REF: v0.3.7
15+
STOOLAP_ENGINE_REF: v0.4.0
1616

1717
jobs:
1818
build:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99
id-token: write
1010

1111
env:
12-
STOOLAP_ENGINE_REF: v0.3.7
12+
STOOLAP_ENGINE_REF: v0.4.0
1313

1414
jobs:
1515
build:

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ import { Database, RunResult } from '@stoolap/node';
127127

128128
#### Persistence
129129

130-
File-based databases persist data to disk using WAL (Write-Ahead Logging) and periodic snapshots. Data survives process restarts.
130+
File-based databases persist data to disk using WAL (Write-Ahead Logging) and an immutable volume-based storage engine. Hot data lives in memory, cold data is sealed into columnar `.vol` files with zone maps, bloom filters, and LZ4 compression. Data survives process restarts.
131131

132132
```js
133133
const db = await Database.open('./mydata');
@@ -148,18 +148,18 @@ await db2.close();
148148
Pass configuration as query parameters in the path:
149149

150150
```js
151-
// Maximum durability: fsync on every WAL write
152-
const db = await Database.open('./mydata?sync=full');
151+
// Maximum durability: fsync on every write
152+
const db = await Database.open('./mydata?sync_mode=full');
153153

154-
// High throughput: no fsync, larger buffers
155-
const db = await Database.open('./mydata?sync=none&wal_buffer_size=131072');
154+
// High throughput: no fsync, data durable at checkpoint
155+
const db = await Database.open('./mydata?sync_mode=none');
156156

157-
// Custom snapshot interval with compression
158-
const db = await Database.open('./mydata?snapshot_interval=60&compression=on');
157+
// Custom checkpoint interval with compression
158+
const db = await Database.open('./mydata?checkpoint_interval=60&compression=on');
159159

160160
// Multiple options
161161
const db = await Database.open(
162-
'./mydata?sync=full&snapshot_interval=120&keep_snapshots=10&wal_max_size=134217728'
162+
'./mydata?sync_mode=normal&checkpoint_interval=120&compact_threshold=4'
163163
);
164164
```
165165

@@ -169,26 +169,22 @@ Controls the durability vs. performance trade-off:
169169

170170
| Mode | Value | Description |
171171
|------|-------|-------------|
172-
| `none` | `sync=none` | No fsync. Fastest, data may be lost on crash |
173-
| `normal` | `sync=normal` | Fsync on commit batches. Good balance (default) |
174-
| `full` | `sync=full` | Fsync on every WAL write. Slowest, maximum durability |
172+
| `none` | `sync_mode=none` | No fsync. Data durable only after checkpoint |
173+
| `normal` | `sync_mode=normal` | Fsync every 1 second (batched). DDL fsyncs immediately (default) |
174+
| `full` | `sync_mode=full` | Fsync on every write. Maximum durability |
175175

176176
##### All Configuration Parameters
177177

178178
| Parameter | Default | Description |
179179
|-----------|---------|-------------|
180-
| `sync` | `normal` | Sync mode: `none`, `normal`, or `full` |
181-
| `snapshot_interval` | `300` | Seconds between automatic snapshots (5 min) |
182-
| `keep_snapshots` | `5` | Number of snapshot files to retain |
183-
| `wal_flush_trigger` | `32768` | WAL flush trigger size in bytes (32 KB) |
184-
| `wal_buffer_size` | `65536` | WAL buffer size in bytes (64 KB) |
185-
| `wal_max_size` | `67108864` | Max WAL file size before rotation (64 MB) |
186-
| `commit_batch_size` | `100` | Commits to batch before syncing (normal mode) |
187-
| `sync_interval_ms` | `10` | Minimum ms between syncs (normal mode) |
180+
| `sync_mode` | `normal` | Sync mode: `none`, `normal`, or `full` |
181+
| `checkpoint_interval` | `60` | Seconds between checkpoint cycles (seal + compact + WAL truncate) |
182+
| `compact_threshold` | `4` | Number of cold volumes before compaction merges them |
183+
| `checkpoint_on_close` | `on` | Seal all hot rows on clean shutdown for fast startup |
188184
| `wal_compression` | `on` | LZ4 compression for WAL entries |
189-
| `snapshot_compression` | `on` | LZ4 compression for snapshots |
190-
| `compression` | | Set both `wal_compression` and `snapshot_compression` |
191-
| `compression_threshold` | `64` | Minimum bytes before compressing an entry |
185+
| `volume_compression` | `on` | LZ4 compression for cold volume files |
186+
| `compression` | `on` | Shorthand: set both `wal_compression` and `volume_compression` |
187+
| `keep_snapshots` | `5` | Number of backup snapshot files to retain |
192188

193189
#### Cloning
194190

0 commit comments

Comments
 (0)