filesystem_raid 1.0.0
filesystem_raid: ^1.0.0 copied to clipboard
A professional Dart library implementing RAID 0/1/5 on the local filesystem with striping, mirroring, parity (XOR/Reed-Solomon), health monitoring, compression, and encryption in pure software.
Changelog #
All notable changes to filesystem_raid will be documented in this file.
The format follows Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 — 2026-05-31 #
Added #
Core Architecture
FilesystemRaid— top-level orchestrator with full write/read/delete/list/recover APIFilesystemRaidBuilder— fluent builder for ergonomic configurationRaidStrategyinterface — clean contract for all RAID implementations
RAID Levels
- RAID 0 (Striping): parallel writes/reads, zero overhead, no fault tolerance
- RAID 1 (Mirroring): full data copy to all disks, tolerates N-1 disk failures
- RAID 5 (Striping with distributed parity): balanced performance + redundancy, tolerates 1 disk failure; distributed parity with left-symmetric rotation
Parity Engine
ParityCalculator— XOR-based parity with single-chunk and full-stripe recoveryReedSolomonCodec— GF(2⁸) Reed-Solomon codec with Vandermonde matrix encoding; tolerates multiple disk failures (configurable parity shard count)ParityRecovery— high-level coordinator; switches between XOR and RS automatically
Storage Layer
DiskManager— low-level disk I/O with health probing, write retry, simulated failuresChunkHandler— encode/decode pipeline (compress → encrypt → checksum)FileRegistry— JSON-backed per-disk file catalogueStorageInfo— aggregated capacity and utilisation statistics
Utilities
ChunkSplitter— zero-copy split/merge with zero-padding and length restorationFileHasher— SHA-256 / MD5 helpers with constant-time comparisonRaidCompression— DEFLATE with 4-byte magic header for transparent detectionRaidEncryption/ChunkHandler.encryptChunk— AES-256-CBC with random IV per chunkRaidLogger/OperationLogger— levelled structured logging with ANSI colour
Models
RaidConfig— immutable config with derived efficiency and fault-tolerance helpersDiskStatus— disk health snapshot with utilisation metricsChunkMetadata— JSON-serialisable per-chunk metadata (checksum, compression, encryption flags)RecoveryReport— detailed recovery outcome with per-file and per-disk records
Exceptions
RaidConfigurationException,DiskFailedException,ChunkNotFoundException,RaidFileNotFoundException,InsufficientSpaceException,CorruptedDataException,RaidNotRecoverableException,TooManyDiskFailuresException,RaidRecoveryException,MetadataException,ParityException
Tests
parity_test.dart— XOR calculation, stripe recovery, rotationreed_solomon_test.dart— encode, 1-shard recovery, 2-shard recovery, round-tripschunk_splitter_test.dart— split, merge, pad, equalise, round-tripsdisk_manager_test.dart— init, write, read, delete, failure simulationraid_0_test.dart— write/read, delete, failure, 1 MiB round-tripraid_1_test.dart— mirroring, 2-disk failure, recoveryraid_5_test.dart— data/parity disk failure, recovery, builderintegration_test.dart— full end-to-end scenarios for all RAID levels
Examples
basic_usage.dart— minimal write/read/recover demonas_setup.dart— home NAS simulation with health monitoringrecovery_example.dart— all four recovery scenarios side-by-side
[Unreleased] #
Planned #
- RAID 6 support (double-parity, tolerates 2 disk failures)
- Async health callback / event stream for real-time monitoring
- Hot-spare disk support for automatic online rebuilds
- S3-compatible backend adapter (store chunks on object storage)
- Web UI dashboard for disk health and array status
- Benchmark suite (throughput, latency, recovery time)