DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

SwayDB


SwayDB is an embedded NoSql database. By 'embedded' they mean it is used as embedded inside an application, so it assumes only one client uses it at the same time. It can be configured for both persistent and in-memory storage. It provides Scala and Java API, and is non-blocking and type-safe. It reaches up to 600,000 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]

Source Code
https://github.com/simerplaha/SwayDB[02]
Developer
Country of Origin
AU
Start Year
2018 [04]
Project Types
Commercial, Open Source
Written in
Scala
Supported Languages
Java, Scala
License
AGPL v3

Database Entry

SwayDB


SwayDB is an embedded NoSql database. By 'embedded' they mean it is used as embedded inside an application, so it assumes only one client uses it at the same time. It can be configured for both persistent and in-memory storage. It provides Scala and Java API, and is non-blocking and type-safe. It reaches up to 600,000 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 development and is still 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.

Foreign Keys


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.

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.

Revision #5