EpochDB π¦
EpochDB is not just another key-value store. It's an opinionated database engine built on the robust foundation of sled, designed specifically for workloads where the relevance of data changes over time.
It provides a high-level, ergonomic API to solve common problems like caching, session management, and real-time analytics by treating data's access frequency and age as first-class citizens.
π€ Why EpochDB?
Many applications need to handle data that isn't meant to live forever. Think of user sessions, cached API responses, or event streams. Managing this "transient" data can be complex. You need to worry about:
- Performance: How do you track usage without slowing down your main application?
- Storage: How do you prevent old, unused data from filling up your disk?
- Concurrency: How do you handle everything safely in a multi-threaded environment?
EpochDB solves these problems out-of-the-box with a clean, simple API.
β¨ Core Features
- Intelligent Data Lifecycle: Automatically prunes old, unused data based on a configurable grace period and frequency threshold.
- Performance-First Architecture: Uses a multi-tree system to separate "hot," frequently-updated metadata from "cold," larger data blobs. This maximizes
sled's page cache efficiency. - Concurrency-Safe by Design: All core operations are thread-safe. Frequency counters are updated atomically using race-proof
compare-and-swaploops. - Durable & Crash-Safe: Inherits the industrial-strength durability and crash-safety guarantees of
sled's Write-Ahead Log. - Ergonomic API: Provides a simple, high-level API that abstracts away the complexity of the underlying storage engine.
π Quick Start
Get started with EpochDB by adding it to your Cargo.toml:
[]
= "0.3.6"
Basic Usage
use DB;
use Path;
use Duration;
πΊοΈ Roadmap
EpochDB is actively being developed. Our goal is to create the best tool for managing ephemeral and usage-tracked data in the Rust ecosystem.
-
V1 (The Core Engine)
- Two-tree architecture (
data_tree,metadata_tree). - Core API (
set,get,remove,increment_frequency). - Robust TTL / Data Lifecycle background thread.
- Polished documentation and examples.
- Two-tree architecture (
-
V2 (Production Readiness)
- Simple, robust backup engine (
db.backup_to(...)). - Observability (expose performance metrics for Prometheus).
- Ergonomic, high-level transaction API.
- Simple, robust backup engine (
-
V3 (The Ecosystem)
- Optional networked server (gRPC or custom TCP protocol).
- A simple CLI tool for database inspection and management.
- A TUI or web-based dashboard for viewing stats.
β€οΈ Contributing
Contributions are welcome and greatly appreciated! This project is a fantastic opportunity to dive into systems programming, database internals, and high-performance Rust.
If you're interested in helping, please:
- Fork the repository.
- Take a look at our Roadmap and the open Issues. Issues marked with
[Help Wanted]orgood first issueare great places to start. - Feel free to open a new issue to discuss a feature or a bug.
- Submit a pull request with your changes. Please ensure your code is tested and documented.
We are building a welcoming and collaborative community. Let's build something great together!
π License
This project is licensed under the MIT license