SwayDB v0.16.2 Release Notes

Release Date: 2020-10-09 // about 1 year ago
    • โž• added MultiPrepareBuilder for creating MultiPrepare instance for MultiMap from Java.
    • ๐Ÿ“‡ renamed Bag.Less to Glass and Bag.less instance to Bag.glass. Glass being a transparent type.
    • โœ‚ removed redundant BAG[_] type param from getKeyValueDeadline functions
    • โฌ†๏ธ bumped ZIO version to 1.0.2

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 NavigableMap (for SequentialOrder writes) backed by Array and binary-search which can be enabled for applications that only require sequential writes and do not need random writes.

    The following shows benchmarks of SequentialOrder (Array) vs RandomOrder (java.ConcurrentSkipListMap) for sequential writes.

    image

    How to optimise SwayDB for SequentialOrder writes?

    0๏ธโƒฃ Default setting optimises writes for RandomOrder. The following code samples optimise writes for SequentialOrder.

    initialSkipListLength sets the length of the Array since SequentialOrder is backed by Array.

    Java

    Map\<Integer, String, Void\> map =MemoryMap .functionsOff(Default.intSerializer(), Default.stringSerializer()) .setOptimiseWrites(OptimiseWrites.sequentialOrder(10000)) .get();
    

    Scala

    val map = memory.Map[Int, String, Nothing, Bag.Less]( optimiseWrites = OptimiseWrites.SequentialOrder(initialSkipListLength = 10000) )
    

    Atomic SkipList reads

    Previously SkipList required copying in-memory key-values for atomicity (#124). Now LevelZero performs atomic reads without copying.

    0๏ธโƒฃ Default setting disables Atomic which can be enabled with the following.

    Java

    Map\<Integer, String, Void\> map =MemoryMap .functionsOff(Default.intSerializer(), Default.stringSerializer()) .setAtomic(Atomic.on()) .get();
    

    Scala

    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 LevelZero for each read. Now snapshotting happen lazily (Stream like) as the read progresses. This change was aimed to further minimise GC workload.