#in-memory #storage #durable #high-concurrency


HighConcurrency, RealTime, InMemory storage inspired by erlang mnesia

23 stable releases (5 major)

6.2.0 Oct 27, 2023
6.1.8 Jul 21, 2023
6.1.0 Feb 18, 2023
5.0.3 Feb 6, 2023
1.1.2 Jul 5, 2022

#218 in Database interfaces

Download history 96/week @ 2023-08-20 88/week @ 2023-08-27 50/week @ 2023-09-03 22/week @ 2023-09-10 53/week @ 2023-09-17 134/week @ 2023-09-24 31/week @ 2023-10-01 37/week @ 2023-10-08 34/week @ 2023-10-15 72/week @ 2023-10-22 115/week @ 2023-10-29 31/week @ 2023-11-05 20/week @ 2023-11-12 46/week @ 2023-11-19 147/week @ 2023-11-26 29/week @ 2023-12-03

245 downloads per month
Used in http-cache-darkbird




DarkBird is a document-oriented, real-time, in-memory database solution optimized for fast document retrieval.


  • Database level: darkbird was storage, but from ( vsn 5.0.3 ) is full-featured database because provide Schema for building database and all operation do with database layer
  • Persistent: Uses a non-blocking write-ahead-logging engine for data persistence, storing data to multiple pages.
  • In-memory: Data is stored in memory, with two modes (DiskCopies, RamCopies), the first persisting data to disk and reloading the data into memory after restart.
  • Concurrency: Uses a high-concurrent HashMap (DashMap) and doesn't require Mutex/RwLock for thread synchronization.
  • Vector: darkbird provide a vector engine for storing and searching vectors
  • Indexing: Supports indexing, allowing for dynamic decision-making about which document fields to index.
  • Full-text search: Supports full-text search operations since version 3.5.0.
  • Materialized view: Provides a trait for the document model (doc.filter(...)) that returns Some(view_name) or None when a document is inserted into the storage.
  • Tagging: Each document can have multiple tags, and one tag can refer to many documents, making it great for indexing groups of documents for fast retrieval by key.
  • Expiration: from vsn 6.0.0 support key expiry.
  • Atomic Operation: from vsn 6.0.0 support Atomic Operation (just like redis setNx)
  • Migration: The storage model is (Key, Document), and you can use migration to change the existing (Key, Document) data on disk before opening the storage.
  • Backup / Restore from vsn-6.1.0 support Backup/Restore
  • External database support: Copy storage data to Postgres/Cassandra/Scylla and load from it.
  • Event handling: Subscribe to any channel to receive events.


darkbird = "6.2.0"


See the complete examples here.


  • 2.0.0: Improved performance and added persistent copy of whole data to a database.
  • 3.0.0: Implemented indexing, tagging, and range queries. Document model must implement tree trait from this version
  • 3.5.0: Added full-text search API
  • 4.0.0: Added materialized view support. Document models must implement the MaterializedView trait, and API is provided to fetch view models. Uses &str instead of &String for better performance and API compatibility. All examples are updated.
  • 5.0.1: migrated from Storage to Database world with Schema builder and Database layer to do all operation also is compatible with older version
  • 5.0.2: fixedbug persist indexing and changed fullText search api for a bug all examples updates
  • 5.0.3: fixedbug loader
  • 6.0.0: added another storage Engine for supporting: atomic operation (just like redis setNx), expiration and simpler api
  • 6.0.1: Backup/Restore _ new migration component (recover self if occure error)
  • 6.2.0: Vector Engine


~442K SLoC