SwayDB

maintenance

by Simer Plaha · since 2018

Embeddable persistent and in-memory key-value engine for the JVM with typed Scala and Java APIs.

key-valueembedded libraryopen source (permissive)emerging

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

✓TTL / expiry
✓In-memory
✓Durable persistence
–Transactions
–Joins
–Secondary indexes
–Full-text search
–Vector search
–Geospatial
–JSON
–Change data capture
–Triggers
–Stored procedures
–Materialized views
–Pub/Sub
–Columnar storage
–Compression
–Encryption at rest
–Role-based access
–Time travel
–Branching
–Online schema changes
–Streaming ingest
–Offline sync
–Runs in WebAssembly

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

Self-hosted Vendor-managed cloud Serverless Embedded Edge Kubernetes operator

Ecosystem

client languagesScala, Java

Alternatives to SwayDB

Compare all→
RocksDBKey-Value48.2

Meta's embeddable LSM-tree key-value engine, the storage layer under dozens of databases.

swaydb vs rocksdb →
MapDBKey-Value7.6

Embedded Java database exposing concurrent Maps, Sets and Queues backed by disk or off-heap memory.

swaydb vs mapdb →
XodusKey-Value6.8

JetBrains' embedded transactional Java/Kotlin store behind YouTrack; in sunset in favour of YouTrackDB.

swaydb vs xodus →
Chronicle MapKey-Value8.7

Off-heap, memory-mapped key-value store for Java with microsecond latency and cross-process sharing.

swaydb vs chronicle-map →
LMDBKey-Value39.7

Tiny memory-mapped B+tree with ACID transactions and lock-free readers; reached 1.0 in 2026.

swaydb vs lmdb →
NutsDBKey-Value3.6

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.