Type-safe & non-blocking key-value storage library for single/multiple disks and in-memory storage.
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.
- 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]
)
- Key-value (
- 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
//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)
}
- SwayDB.examples - Examples demonstrating features and APIs.
- SwayDB.benchmark - Benchmarks for write and read performance.
- SwayDB.stress - Stress tests.
- SwayDB.io - Website code.
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.