zeytin_local_storage 2.0.0
zeytin_local_storage: ^2.0.0 copied to clipboard
Zeytin is a database solution developed with care and love for server and local solutions.
1.0.0 #
- Hello World!
1.1.0 #
- Improvements on the Zeytin Engine.
- The use of adapters has been completely removed from Zeytin.
1.1.2 #
- ZeytinValue update.
1.2.0 #
- License Changed.
1.2.1 #
- Zeytin engine now supports getAllBoxes.
- The getAllBoxes function has been added to the ZeytinStorage class. You can now retrieve all your boxes.
1.2.2 #
- Readme Update.
2.0.0 #
Major Update | Database Engine Evolution
This update introduces a major architectural shift in the storage engine. While the data structure has been enhanced with new safety elements, a robust backward-compatibility layer is included. Zeytin Engine will automatically detect and migrate database files from older versions (v1.x) to the new v2 format.
IMPORTANT: Although automatic migration is supported, we strongly recommend backing up your data before upgrading. This version should be thoroughly tested in your environment before production use.
New Features #
- BigInt Support: Added native support for the
BigIntdata type inBinaryEncoder. Large integers can now be serialized and deserialized directly without losing precision. - Compare-And-Swap (CAS) Support: Introduced the
putCASmethod. This allows for atomic, conditional updates: "Update only if the current value matches the expected value," preventing data races in complex workflows. - Sync/Async Write Control: Methods like
put,delete, anddeleteBoxnow include asyncparameter. You can choose between high-speed asynchronous execution (default) or guaranteed disk-flush execution (sync: true).
Performance & Optimization #
- Smart Write Buffering: A new in-memory
_writeBufferreduces disk I/O bottlenecks. Data is flushed in batches based on thresholds (100 operations or 500ms), significantly increasing throughput. - Fire-and-Forget Communication:
writeFast,removeTagFast, andremoveBoxFastmethods enable Isolate communication without blocking the main thread, allowing the UI or main logic to remain responsive. - Zero-Latency Update Checks:
Zeytin.putnow performs update checks via the high-speed_memoryCacheinstead of querying the Isolate/Disk, drastically reducing write latency.
Data Security & Recovery #
- CRC32 Checksum Protection: Every data block now includes a 4-byte CRC32 integrity code. The engine verifies this checksum during every read operation to detect and prevent data corruption.
- Transactional Integrity (WAL): Buffered writes are now wrapped in
TX_STARTandTX_COMMITblocks. This ensures that even if a crash occurs during a write, the database remains in a consistent state. - Advanced Repair System: The
_repairlogic has been completely overhauled to handle transaction logs and skip corrupted segments using CRC32 validation, ensuring maximum data recovery.