walpack 0.1.0
walpack: ^0.1.0 copied to clipboard
High-performance, crash-safe, single-file binary container with chunked storage and append-only write-ahead log (WAL) for Dart.
0.1.0 #
- Initial release of
walpack: single-file binary container (WLPKv1) with immutable chunked snapshot storage, append-only CRC32-C Write-Ahead Log (WAL), and Copy-on-Write (CoW) compaction (atomicReplace+rename()). - High-throughput pure-Dart primitives built on
pro_binary:- Slicing-by-8 CRC32-C (including
crc32cCombineGF(2) composition to eliminate duplicate chunk scans during WAL commits) and 32-bit stripe XXH32 integrity checks. - Pure-Dart LZ4 block codec (L1 hash table + exponential doubling match
decoder + 64-bit fast-loop) plus native
ZLibChunkCodec. - Scatter-gather commit frames (
writeView+takeChunks()), a zero-builderappendOp()/appendOpWith()fast path, optionalreadCacheBytesLRU cache, and offset-sorted read-coalescedreadChunks()batch reads. - Native sorted primary-key binary search (
keysWithPrefix,keysInRange,readPrefix,readRange) and Snapshot+WALint/Stringsecondary indexes (queryIntIndex,queryStringIndex,readIntIndex,readStringIndex). IoStorageBackendwith lazy single open, dirty-trackedclose(), cursor tracking (_knownPos),IoMode(hybridwith<= 256 KiBsync path /sync/async), Windows transient-handle support (keepHandleOpen), and 512 KiBFastCopyStorageBackend.copyRangeTopass-through compaction.
- Slicing-by-8 CRC32-C (including
- Production hardening & cross-process coordination:
WalPackLimitsbounded decoding (including bounded chunked ZLib inflation against oversized/zip-bomb payloads) and structural TOC/Base Index/WAL validation (duplicate keys, duplicate index ordinals,[64, tocOffset]range checks, bounded strings/frames).- Isolated
MemoryStorageBackend.readAtcopies, strict bounds validation across storage backends, canonicalizedAdjacentLockStrategy, and synchronized lock-registry cleanup. - Live partial-write rollback (
truncate(_walEndOffset)) on failed commits. - Optimistic Concurrency Control (
expectedSeq->CommitConflict) andGenerationAwareLockStrategy(TempDirLockStrategy,AdjacentLockStrategy) with 8-byte lock-file generation tracking. - Pluggable
StorageBackend(native file I/O, Web/WASMMemoryStorageBackend,FaultInjectionBackend), verified across unit/fuzz/oracle/interop/Node.js suites.