SwayDB v0.16.2 Release NotesRelease Date: 2020-10-09 // almost 2 years ago
- ➕ added
- 📇 renamed
Glassbeing a transparent type.
- ✂ removed redundant
BAG[_]type param from
- ⬆️ bumped ZIO version to 1.0.2
- ➕ added
Previous changes from v0.16.1
🚀 Release overview
- 👌 Improved SkipList implementation for faster writes and atomic reads
- ✂ Removed snapshotting LevelZero state for reads.
👌 Improved write performance for sequential writes
Implemented a faster
SequentialOrderwrites) backed by
Arrayand binary-search which can be enabled for applications that only require sequential writes and do not need random writes.
The following shows benchmarks of
RandomOrder(java.ConcurrentSkipListMap) for sequential writes.
How to optimise SwayDB for SequentialOrder writes?
0️⃣ Default setting optimises writes for
RandomOrder. The following code samples optimise writes for
initialSkipListLengthsets the length of the
SequentialOrderis backed by
Map\<Integer, String, Void\> map =MemoryMap .functionsOff(Default.intSerializer(), Default.stringSerializer()) .setOptimiseWrites(OptimiseWrites.sequentialOrder(10000)) .get();
val map = memory.Map[Int, String, Nothing, Bag.Less]( optimiseWrites = OptimiseWrites.SequentialOrder(initialSkipListLength = 10000) )
Atomic SkipList reads
SkipListrequired copying in-memory key-values for atomicity (#124). Now
LevelZeroperforms atomic reads without copying.
0️⃣ Default setting disables
Atomicwhich can be enabled with the following.
Map\<Integer, String, Void\> map =MemoryMap .functionsOff(Default.intSerializer(), Default.stringSerializer()) .setAtomic(Atomic.on()) .get();
val map = memory.Map[Int, String, Nothing, Bag.Less](atomic = Atomic.On)
✂ Removed snapshotting
🌲 Previously reads were creating a snapshot which provided the state of write-ahead-log files in
LevelZerofor each read. Now snapshotting happen lazily (Stream like) as the read progresses. This change was aimed to further minimise GC workload.