SwayDB
maintenanceby Simer Plaha · since 2018
Embeddable persistent and in-memory key-value engine for the JVM with typed Scala and Java APIs.
maintenance. README still says 'under testing'; last release 0.16.2 (October 2020) and last commit June 2024. RocksDB or MapDB are safer JVM choices.
Overview
SwayDB is Simer Plaha's non-blocking storage engine for Scala and Java: you open typed Map, Set, MultiMap or Queue structures that are either persistent or purely in-memory, with key expiry and range iteration. Data is log-structured with background compaction, and it can spread segments across several local SSDs and dedicate thread pools to reads, caching and compaction, all in a jar of about 7 MB with no external core dependency. The README still describes it as under testing and performance optimisation, the last release was 0.16.2 in October 2020 and commits stopped in 2024, so it is better studied than relied on in production.
Strengths & trade-offs
Strengths
- +Same API for persistent and in-memory stores
- +Typed Map, Set, MultiMap and Queue structures out of the box
- +Non-blocking API that fits Scala effect libraries
- +Can spread data across multiple local SSDs with tunable threads
Trade-offs
- −Never declared production-ready; no release since 2020
- −Single maintainer and a small user base
- −JVM only
Great for
- +Experimenting with embedded storage in Scala
- +Studying LSM-style engine design on the JVM
Think twice for
- −Production systems that need a maintained engine
- −Non-JVM applications
Capabilities
Native or official first-party support · 3 of 25 tracked
Scale & consistency
- Comfortable data size
- Small · ≤ 100 GB
- Horizontal scaling
- None
- Multi-region
- No
- Transactions
- Limited ACID
- Consistency
- Strong
- Schema
- Schemaless
- Architecture
- Embedded, In memory
- Query languages
- Scala/Java API
Single machine, but can spread data over several local disks.
Deployment
Ecosystem
Alternatives to SwayDB
Meta's embeddable LSM-tree key-value engine, the storage layer under dozens of databases.
swaydb vs rocksdb →Embedded Java database exposing concurrent Maps, Sets and Queues backed by disk or off-heap memory.
swaydb vs mapdb →JetBrains' embedded transactional Java/Kotlin store behind YouTrack; in sunset in favour of YouTrackDB.
swaydb vs xodus →Off-heap, memory-mapped key-value store for Java with microsecond latency and cross-process sharing.
swaydb vs chronicle-map →Tiny memory-mapped B+tree with ACID transactions and lock-free readers; reached 1.0 in 2026.
swaydb vs lmdb →Pure-Go embedded key-value store with Bitcask storage and Redis-like lists, sets and sorted sets.
swaydb vs nutsdb →SwayDB FAQ
What is SwayDB?
SwayDB is a key-value database by Simer Plaha, first released in 2018. SwayDB is Simer Plaha's non-blocking storage engine for Scala and Java: you open typed Map, Set, MultiMap or Queue structures that are either persistent or purely in-memory, with key expiry and range iteration. Data is log-structured with background compaction, and it can spread segments across several local SSDs and dedicate thread pools to reads, caching and compaction, all in a jar of about 7 MB with no external core dependency. The README still describes it as under testing and performance optimisation, the last release was 0.16.2 in October 2020 and commits stopped in 2024, so it is better studied than relied on in production.
Is SwayDB open source?
Yes. SwayDB is open source. License: Apache License 2.0.
Does SwayDB support ACID transactions?
Partly. SwayDB offers limited ACID guarantees (for example, single-record or single-partition transactions), with strong consistency.
Does SwayDB scale horizontally?
SwayDB does not scale horizontally; it runs on a single node, so you scale it up rather than out. It is comfortable at small scale (≤ 100 GB).
How can I run SwayDB?
You can self-host it and embed it in your application.
What is SwayDB best for?
SwayDB is a strong fit for experimenting with embedded storage in Scala and studying LSM-style engine design on the JVM. Think twice for production systems that need a maintained engine.
What are the best alternatives to SwayDB?
Common alternatives to SwayDB include RocksDB, MapDB, Xodus, Chronicle Map and LMDB. The right choice depends on your workload, scale and hosting; WhichDB's smart match ranks them against your requirements.
Is SwayDB still maintained?
SwayDB is in maintenance mode. README still says 'under testing'; last release 0.16.2 (October 2020) and last commit June 2024. RocksDB or MapDB are safer JVM choices.
How popular is SwayDB?
SwayDB ranks #543 of 844 databases on the WhichDB Score (1.5/100), and #89 among key-value databases. The score combines public adoption signals such as package downloads, GitHub activity, job posts and developer discussion.



