You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`--obj-wal-sync-on-commit`| Upload the WAL to the object store after every commit (RPO=0) |
75
87
76
88
**Examples**
77
89
```
@@ -83,12 +95,22 @@ Opened database at './mydb' (unified memtable)
83
95
84
96
admintool> open ./mydb --unified --cache-size 134217728 --flush-threads 4
85
97
Opened database at './mydb' (unified memtable)
98
+
99
+
admintool> open ./mydb --log-level info --log-to-file
100
+
Opened database at './mydb'
101
+
102
+
admintool> open ./mydb --object-store-fs /mnt/objects
103
+
Opened database at './mydb' (object-store fs:/mnt/objects)
86
104
```
87
105
88
106
:::note[Unified Memtable Mode]
89
107
When `--unified` is set, all column families share a single skip list and WAL instead of each column family maintaining its own. A transaction touching N column families results in 1 WAL write instead of N. On-disk SSTables remain per-column-family. This mode is beneficial for write-heavy multi-CF workloads.
90
108
:::
91
109
110
+
:::note[Filesystem Object Store]
111
+
`--object-store-fs <root_dir>` attaches a filesystem-backed object-store connector that mirrors objects under the given directory. This is intended for testing and local replication scenarios. Object-store mode automatically enables unified memtable mode. The connector is destroyed when the database is closed. Combine with `--obj-cache-max-bytes`, `--obj-replica-mode`, `--obj-replica-sync-interval`, and `--obj-wal-sync-on-commit` to tune behavior.
|`--tombstone-density-trigger <ratio>`| Tombstone density above which compaction priority escalates (`0.0` to `1.0`, `0` disables) |
185
+
|`--tombstone-density-min-entries <n>`| Minimum entry count for an SSTable to be considered by the density trigger |
186
+
|`--object-lazy-compaction` / `--no-object-lazy-compaction`| Lazy compaction in object-store mode (doubles the L1 trigger, reducing remote I/O) |
187
+
|`--object-prefetch-compaction` / `--no-object-prefetch-compaction`| Prefetch all input SSTables in parallel before a compaction merge (default: enabled) |
161
188
162
189
**Examples**
163
190
```
@@ -242,8 +269,9 @@ cf-stats <name>
242
269
- Memtable size, levels, total keys
243
270
- Data size, avg key/value sizes
244
271
- Read amplification, cache hit rate
245
-
- Full configuration (compression, bloom filter, sync mode, etc.)
246
-
- Per-level SSTable counts and sizes
272
+
- Full configuration (compression, bloom filter, sync mode, dividing level offset, tombstone density trigger and minimum, object-store lazy/prefetch compaction, etc.)
273
+
- Per-level SSTable counts, sizes, key counts, and tombstone counts
274
+
- Tombstone observability: total tombstones, database-wide ratio, and the worst single-SSTable tombstone density (with the level it lives on)
247
275
- B+tree statistics (if enabled)
248
276
249
277
### cf-status
@@ -276,8 +304,10 @@ All options from `cf-create` are supported except `--btree` and `--comparator` (
276
304
-`--block-index-prefix-len`, `--index-sample-ratio`, `--no-block-indexes` · Block index settings for new SSTables
277
305
-`--skip-list-max-level`, `--skip-list-probability` · Skip list settings for new memtables
Saved configuration of 'users' to './users.ini' (section [users])
336
+
```
337
+
338
+
### cf-config-load
339
+
Create a column family by loading its configuration from an INI file section. Useful for replicating a tuned configuration across databases or for templating column families.
Created column family 'users_replica' from './users.ini' [users]
348
+
```
349
+
296
350
## Key-Value Operations
297
351
298
352
### put
@@ -323,6 +377,22 @@ Delete a key.
323
377
delete <cf> <key>
324
378
```
325
379
380
+
### single-delete
381
+
Tombstone a key with single-delete semantics. Compaction can drop the put and the tombstone together as soon as both appear in the same merge input, rather than carrying the tombstone forward to the largest level.
382
+
```
383
+
single-delete <cf> <key>
384
+
```
385
+
386
+
:::caution[When to use]
387
+
`single-delete` is only safe when each key is put at most once between any two single-deletes (and at most once before the first single-delete on that key). Violating the contract can leave older puts visible after the tombstone. Prefer `delete` for any workload that issues repeated updates to the same key.
388
+
:::
389
+
390
+
**Example**
391
+
```
392
+
admintool(./mydb)> single-delete users user:1
393
+
OK
394
+
```
395
+
326
396
### scan
327
397
Scan all keys in a column family.
328
398
```
@@ -483,6 +553,31 @@ Trigger compaction on a column family.
483
553
compact <cf>
484
554
```
485
555
556
+
### compact-range
557
+
Run a synchronous compaction over a specific key range. Only SSTables whose minimum and maximum keys overlap the requested range participate in the merge, so the work and I/O are bounded to the affected portion of the LSM tree rather than the whole column family.
558
+
```
559
+
compact-range <cf> <start_key> <end_key>
560
+
```
561
+
562
+
**Behavior**
563
+
- Synchronous, blocks the caller until the merge commits or fails
564
+
- Selects only SSTables whose key range overlaps `[start_key, end_key)`
565
+
- Applies the same emit-loop logic as background compactions (tombstone reclamation, single-delete pair cancellation, sequence-based deduplication, value recompression)
566
+
- Output SSTables are committed to the manifest atomically and old inputs are marked for deletion
567
+
568
+
**Use cases**
569
+
- Bulk reclaim after a large range delete, where waiting for natural compaction would leave tombstones on disk
570
+
- Tenant eviction or sliding-window expiration that does not fit TTL semantics
571
+
- Post-import cleanup of a known key range
572
+
- Operational counterpart to the automatic tombstone density trigger when an operator wants reclaim now rather than at the next threshold crossing
|`maxConcurrentFlushes`| int | 0 (library default) | Global semaphore on in-flight memtable flushes across all column families; 0 inherits the engine default |
137
138
|`objectStoreFsPath`| String | null | Filesystem path for object store connector; null disables object store mode |
`getTotalKeys()` includes the active memtable plus every SSTable, so writes are visible to stats without a prior flush. The tombstone observability fields (`getTotalTombstones`, `getTombstoneRatio`, `getMaxSstDensity`, `getMaxSstDensityLevel`, `getLevelTombstoneCounts`) pair with the column family `tombstoneDensityTrigger` and `tombstoneDensityMinEntries` settings to monitor and drive density-based compaction escalation.
Use `purge()` before backup, after bulk deletes, or during maintenance windows. Use `compact()` and `flush()` for non-blocking background work.
383
395
396
+
### Targeted Range Compaction
397
+
398
+
`compactRange` runs a synchronous compaction over a specific key range. Only SSTables whose key range overlaps the bounds participate in the merge, so the work and I/O are bounded to the affected portion of the LSM tree.
byte[] end ="tenant_42;".getBytes(StandardCharsets.UTF_8);
403
+
404
+
store.compactRange(start, end);
405
+
```
406
+
407
+
A null or empty endpoint means unbounded on that side; both null/empty is rejected (use `compact()` for full-CF compaction). Use this after a large range delete, tenant eviction, or when you want to reclaim space immediately rather than waiting for the natural tombstone density trigger to fire.
Updatable settings include `writeBufferSize`, `skipListMaxLevel`, `skipListProbability`, `bloomFPR`, `indexSampleRatio`, `syncMode`, and `syncIntervalUs`.
429
454
455
+
### Single-Delete
456
+
457
+
`singleDelete` writes a tombstone with the same read semantics as `delete`, but lets compaction drop the put and tombstone together as soon as both appear in the same merge input - rather than carrying the tombstone forward until it reaches the largest active level.
458
+
459
+
```java
460
+
TidesDBStore store = (TidesDBStore) context.getStateStore("my-store");
**Caller contract**: between any two single-deletes on the same key, the key has been put **at most once**. The engine cannot verify this; violating the contract can leave older puts visible after the single-delete. Use only for insert-once / delete-once workloads (session caches, secondary-index entries that are never updated, log-style state with scheduled purges). When in doubt, prefer `delete`.
465
+
430
466
### Range Cost Estimation
431
467
432
468
Estimate the cost of iterating between two keys without performing any disk I/O:
Register a custom comparator for use with column families. Built-in comparators include `"memcmp"` (default), `"lexicographic"`, `"uint64"`, `"int64"`, `"reverse"`, and `"case_insensitive"`.
0 commit comments