SwayDB Gitter Chat Build Status

SwayDB is an embeddable database for single/multiple disks and in-memory storage.

Documentation: http://swaydb.io

Performance

Storage type Performance
Persistent up to 308,000 writes/sec & 316,000 reads/sec
In memory up to 653,000 writes/sec & 628,000 reads/sec

View detailed benchmark results here.

Features

  • Non-blocking
  • Single or multiple disks persistent, in-memory or periodically persistent
  • Atomic updates and inserts.
  • APIs similar to Scala collections.
  • Auto expiring key-value (TTL)
  • Range update, remove & expire
  • Key only iterations (Lazily fetched values)
  • Supported data types
    • Map[K, V]
    • Set[T]
  • In-built custom serialization API with Slice
  • Configurable Levels
  • Configurable cacheSize
  • Concurrent level compaction
  • Duplicate values can be detected and written only ones with the configuration compressDuplicateValues.
  • Compression with LZ4 & Snappy are fully supported for both Persistent & Memory databases for each Level.
  • All LZ4 instances, compressors & decompressors are configurable.
    • LZ4 Instances - FastestInstance, FastestJavaInstance, NativeInstance, SafeInstance & UnsafeInstance.
    • LZ4 Compressors - FastCompressor & HighCompressor.
    • LZ4 Decompressors - FastDecompressor & SafeDecompressor.
  • Optional Memory-mapped files
  • Scala Streams
  • Bloom filters

Read more.

Demo API

//Iteration: fetch all key-values withing range 10 to 90, update values and batch write updated key-values
db
  .from(10)
  .tillKey(_ <= 90)
  .map {
    case (key, value) =>
      (key, value + "_updated")
  } andThen {
     updatedKeyValues =>
       db.put(updatedKeyValues)
  }

Quick start

Quick start demo.

Examples

Related GitHub projects

Project status

Undergoing integration, stress & performance testing.

Master branch status

Development is done directly on master. So at times it will be unstable. See the tags to get a more stable version.

Project support

Thank you

Jetbrains support