/SwayDB

Type-safe, non-blocking key-value storage library for single/multiple disks & in-memory - www.SwayDB.io

Primary LanguageScalaGNU Affero General Public License v3.0AGPL-3.0

SwayDB Gitter Chat

Type-safe & non-blocking key-value storage library 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

  • Embeddable, Type-safe, non-blocking
  • Multiple disks, In-memory & periodically persistent
  • ACID like atomic writes with Batch API
  • APIs similar to Scala collections.
  • Expiring key-value (TTL).
  • Range update, remove & expire.
  • Key only iterations (Lazily fetched values)
  • Data storage formats
    • Key-value (Map[K, V])
    • Row (Set[T])
  • In-built custom serialization API with Slice
  • Configurable Levels
  • Configurable cache size
  • Concurrent level compaction
  • Optional Memory-mapped files
  • Scala Streams
  • Bloom filters
  • Fault tolerant

Read more.

Demo

//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.batchPut(updatedKeyValues)
  }

Quick start

Quick start demo.

Examples

Related GitHub projects

Status

Status: Beta

All core APIs for SwayDB are implemented. See the API documentation.

Next few versions require file formats changes to improve data compression.

Backward compatible will be supported for versions 1.* and after So please suggest features & improvements now while we are still in version 0.*.

TODO Code coverage & CI.