SwayDB is an embedded, non-blocking and type-safe NoSql database. It can be configured for both persistent and in-memory storage. It provides Scala and Java API. It reaches up to 600,000 writes per second for in-memory databases and up to 300,000 for persistent databases. Log-structured merge-tree is the main underlying algorithm.[01][03]
- Website
- http://www.swaydb.io[01]
- Source Code
- https://github.com/simerplaha/SwayDB[02]
- Tech Docs
- http://www.swaydb.io[01]
- Developer
- Country of Origin
- AU
- Start Year
- 2018 [04]
- Project Types
- Commercial, Open Source
- Written in
- Scala
- License
- AGPL v3
SwayDB is an embedded, non-blocking and type-safe NoSql database. It can be configured for both persistent and in-memory storage. It provides Scala and Java API. It reaches up to 600,000 writes per second for in-memory databases and up to 300,000 for persistent databases. Log-structured merge-tree is the main underlying algorithm.[01][03]
History[04]
SwayDB started in 2017, and had its first release in 2018. Currently, it is under beta release.
Checkpoints[05]
No checkpoints are supported. For its in-memory implementation, no checkpointing or logging is supported. For the persistent version, it can persist its memory segments to disk, but this is used for reducing that level's storage, not for recovery.
Compression[06]
SwayDB supports compressing segments using LZ4 and Snappy, which are open-sourced Java compression tools.
Concurrency Control[07][08]
SwayDB assumes it runs 'under a single process in a single application', as the author clarifies on Reddit. Everything is atomic in SwayDB, including transactions. The only guarantee it has on transactions is atomicity. No concurrency control is needed, and indeed it is not mentioned in docs at all.
Data Model[01]
SwayDB is a key-value store, having Map[K, V] and Set[T] for data storage and providing APIs to create, read, stream, update, delete & expire data.
Indexes[09]
SwayDB organizes data in levels of segments, using the Log-Structured Merge Tree data structure. Upper levels write to lower levels in batches when it is full or the user explicitly demanded. Bloom Filters are used in each segment to search quickly whether a key belongs to that segment.
Isolation Levels[01]
Since every operation is atomic and runs on the same memory space, it is serializable.
Logging[10]
Write ahead logging is used for its persistent version databases. Because it is a key-value store, it does not have the notion of pages. The logs are physical logging of write operations.
Query Interface[11][12]
SwayDB is used embedded in applications. The API is in Scala with its custom APIs. A Java wrapper is also implemented for Java APIs.
Citations
12 sources- http://www.swaydb.io swaydb.io
- GitHub - simerplaha/SwayDB: Persistent and in-memory key-value storage engine for JVM that scales on a single machine. · GitHub github.com
- https://www.linkedin.com/in/simerplaha/?originalSubdomain=au linkedin.com
- https://twitter.com/SwayDB twitter.com
- http://www.swaydb.io/create-databases/eventually-persistent/ swaydb.io
- http://www.swaydb.io/configuring-levels/groupingStrategy/ swaydb.io
- SwayDB: Type-safe, non-blocking, back-pressured key-value storage library for single/multiple disks & in-memory : r/programming reddit.com
- http://www.swaydb.io/api/write/transaction/ swaydb.io
- http://www.swaydb.io/implementation/level/ swaydb.io
- http://www.swaydb.io/implementation/map/ swaydb.io
- http://www.swaydb.io/api/ swaydb.io
- GitHub - simerplaha/SwayDB.java.examples: Java examples for SwayDB · GitHub github.com