Skip to content

avelino/chrondb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

307 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

ChronDB: The Time-Traveling Database

Chronological key/value Database built on Git architecture with complete version history.

GitHub License Documentation

✨ Features

ChronDB offers unique capabilities for your data:

  • Complete History - Every change is preserved, nothing is ever truly deleted
  • Time Travel - Query your data as it existed at any point in time
  • Multiple Interfaces:
    • 🧩 Native Clojure API - Direct integration for JVM applications
    • πŸ“‘ REST API - HTTP interface for any language
    • πŸ”„ Redis Protocol - Connect using Redis clients
    • πŸ—„οΈ PostgreSQL Protocol - Connect with SQL clients
  • Language Bindings - Embed ChronDB directly in your application:
    • 🐍 Python - ctypes-based client with context manager support
    • πŸ¦€ Rust - Safe wrapper with serde_json integration
  • ACID Transactions - Guaranteed consistency and durability
  • Schemaless Design - Store any JSON-compatible data
  • Git Foundation - Leverage Git's powerful features:
    • Branching and merging for isolated environments
    • Diffs between versions
    • Complete audit trails with commit messages

πŸ” Lucene Search Overhaul

ChronDB's indexing layer now runs entirely on Apache Lucene, replacing the previous bespoke search structures. The upgrade brings production-grade analyzers, configurable secondary and composite indexes, geospatial capabilities, and a query planner with smart caching. The work was motivated by real-world workloads that demanded lower latency and richer search semantics powered by a proven search engine. Dive into the updated documentation to learn how to enable and tune the new indexes for your applications.

πŸš€ Quick Start

Using Docker (Simplest)

# Start ChronDB with all protocols enabled
docker run -d --name chrondb \
  -p 3000:3000 \  # REST API
  -p 6379:6379 \  # Redis protocol
  -p 5432:5432 \  # PostgreSQL protocol
  -v chrondb-data:/data \
  avelino/chrondb:latest

Using Clojure

In your deps.edn:

{:deps {com.github.avelino/chrondb {:git/tag "v0.2.1"
                                     :git/sha "..."}}}

Then in your code:

(require '[chrondb.core :as chrondb])

;; Create a database connection
(def db (chrondb/create-chrondb))

;; Create a document
(chrondb/save db "user:1" {:name "Alice" :email "alice@example.com"})

;; Update the document
(chrondb/save db "user:1" {:name "Alice" :email "alice@example.com" :role "admin"})

;; Time travel: see how the document looked at a specific point in time
(def yesterday (chrondb/get-at db "user:1" "2023-07-15T00:00:00Z"))

;; See all versions of the document
(def history (chrondb/history db "user:1"))

Running the Server

# Clone the repository
git clone https://github.com/avelino/chrondb.git
cd chrondb

# Run with default settings (REST on 3000, Redis on 6379, PostgreSQL on 5432)
clojure -M:run

# Or with custom ports
clojure -M:run 8080 6380 5433

🧠 Concept

ChronDB maps database concepts to Git's structure:

  • Database β†’ Git repository
  • Schema β†’ Git branch
  • Table β†’ Directory in repository
  • Document β†’ JSON file in directory
  • History β†’ Commit timeline

This approach gives you all the power of Git for your database operations.

πŸ“š Documentation

Complete documentation is available at chrondb.avelino.run

πŸ› οΈ Requirements

  • Java 11 or later
  • Git 2.25.0 or later

πŸ’¬ Community

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

πŸ“„ License

ChronDB is licensed under the terms of the GNU Affero General Public License v3.0 (AGPLv3).

This means:

  • You are free to use, study, modify, and redistribute the software.
  • If you run a modified version as a network service, you must make the source available to users of that service.
  • See the LICENSE file for full details or visit gnu.org/licenses/agpl-3.0.

About

Chronological key/value Database built on Git architecture with complete version history

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors