SwayDB v0.16.2 Release Notes
Release Date: 2020-10-09 // over 4 years ago-
- โ added
MultiPrepareBuilder
for creatingMultiPrepare
instance forMultiMap
from Java. - ๐ renamed
Bag.Less
toGlass
andBag.less
instance toBag.glass
.Glass
being a transparent type. - โ removed redundant
BAG[_]
type param fromgetKeyValueDeadline
functions - โฌ๏ธ 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
NavigableMap
(forSequentialOrder
writes) backed byArray
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) vsRandomOrder
(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 forSequentialOrder
.initialSkipListLength
sets the length of theArray
sinceSequentialOrder
is backed byArray
.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). NowLevelZero
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.