@pebbl/core
v0.1.1
Published
In-memory store, Last-Write-Wins conflict resolution, append-only log persistence, and recovery for Pebble
Maintainers
Readme
@pebbl/core
In-memory state machine, Last-Write-Wins (LWW) conflict resolution, append-only NDJSON mutation log, and crash recovery pipeline for Pebble.
This package is completely decoupled from the network layer.
Installation
pnpm add @pebbl/coreFeatures
- Store: In-memory state machine maintaining current winning values, full mutation history index, version vectors, and monotonic sequence counters.
- LWW Conflict Resolution: Deterministic multi-dimensional comparison:
- Highest
timestampwins. - If equal, lexicographical
nodeIdtiebreak. - If same node, highest
sequencetiebreak.
- Highest
- Append-Only Mutation Log:
MutationLogwith fsync durability and corrupted tail recovery (skips incomplete lines written during power loss/abrupt crashes). - Snapshots & Metadata: Point-in-time state snapshots and atomic metadata persistence with crash-safe temporary file swapping.
- Recovery Pipeline:
recover()automatically restores state from the latest snapshot and replays subsequent log mutations.
License
MIT
