SwayDB Gitter Chat Build Status

Embeddable persistent and in-memory database.

Documentation: http://swaydb.io


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.


  • 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 Streaming API

//Iteration: fetch all key-values withing range 10 to 90, update values and batch write updated key-values
  .takeWhile {
    case (key, value) =>
      key <= 90
  .map {
    case (key, value) =>
      (key, value + "_updated")
  .flatMap(db.put) //write updated key-values to database

Quick start

Quick start demo.


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