Sign inSign up

mihirrabariii/veddb

By mihirrabariii

•Updated 10 months ago

High-performance document database with built in adaptive caching system

Image
Databases & storage
0

476

mihirrabariii/veddb repository overview

⁠VedDB

VedDB is a high-performance document database built in Rust. It combines persistent document storage and in-memory caching into a single engine, so you don’t have to run a database and a cache separately.

Fast, predictable, and designed to stay boring in production.


⁠Quick Start

⁠Pull the image
docker pull mihirrabariii/veddb:latest
⁠Run with default settings
docker run -d \
  -p 50051:50051 \
  mihirrabariii/veddb:latest
⁠Run with persistence
docker run -d \
  -p 50051:50051 \
  -v veddb-data:/var/lib/veddb/data \
  mihirrabariii/veddb:latest

⁠What VedDB Focuses On

⁠Speed without shortcuts

VedDB keeps frequently accessed data in memory and routes everything else to disk automatically. Reads for cached data are sub-millisecond, and the system is built to handle high write and read throughput without heavy tuning.

⁠One engine, not two

You get a document database and a cache in the same process. Documents live on disk, hot fields or keys live in memory, and the engine decides where reads and writes should go based on schema configuration.

⁠Schema-driven caching

Caching is part of the schema, not an afterthought. You can choose:

  • no cache
  • write-through
  • write-behind
  • read-through

Cache invalidation and consistency are handled internally.

⁠Data safety

All writes go through a write-ahead log. Snapshots are created periodically, and the database can recover to a specific point in time using WAL replay.

⁠Security by default
  • AES-256-GCM encryption at rest
  • TLS 1.3 for all connections
  • Encrypted WAL and snapshots
  • Automatic key rotation
  • Optional per-collection encryption keys
⁠Authentication and access control
  • Username / password authentication (bcrypt)

  • JWT authentication (RS256)

  • Role-based access control:

    • Admin
    • ReadWrite
    • ReadOnly
  • Full audit logging for sensitive operations

⁠Replication

VedDB supports master-slave replication. Slaves sync using a snapshot first and then receive incremental WAL updates. Reads can be served from replicas, and slaves can be promoted manually.

⁠Querying

Documents are queried using MongoDB-style operators:

  • $eq, $ne, $gt, $gte, $lt, $lte
  • $in, $nin, $exists, $regex
  • $and, $or, $not

Projection, sorting, pagination, and indexes all work together through a query planner.

⁠Indexes
  • Single-field indexes
  • Compound indexes
  • Unique indexes
  • Background index builds
  • Index usage statistics
⁠Data structures

Alongside documents, VedDB supports Redis-style data structures:

  • strings
  • lists
  • sets
  • sorted sets
  • hashes
  • bitmaps
  • HyperLogLog
⁠Pub/Sub
  • Channel-based publish/subscribe
  • Pattern subscriptions
  • Bounded subscriber queues
  • Backpressure handling
⁠Monitoring

VedDB exposes Prometheus metrics for:

  • operations per second
  • latency
  • cache hit rate
  • memory usage
  • active connections
  • replication lag

A health check endpoint is also available.


⁠Docker Compose Example

version: "3.8"

services:
  veddb:
    image: mihirrabariii/veddb:latest
    ports:
      - "50051:50051"
    volumes:
      - veddb-data:/var/lib/veddb/data
      - veddb-backups:/var/lib/veddb/backups
    environment:
      RUST_LOG: info
      VEDDB_CACHE_SIZE: 512
    restart: unless-stopped

volumes:
  veddb-data:
  veddb-backups:

⁠Configuration

⁠Environment Variables
RUST_LOG           Logging level (trace | debug | info | warn | error)
VEDDB_CACHE_SIZE   Cache size in MB (default: 256)
VEDDB_MASTER_KEY   Master encryption key
⁠Command Line Example
docker run -d \
  -p 50051:50051 \
  -v veddb-data:/var/lib/veddb/data \
  mihirrabariii/veddb:latest \
  veddb \
    --enable-backups \
    --backup-dir /var/lib/veddb/backups \
    --enable-encryption \
    --cache-size 1024

⁠Health Check

healthcheck:
  test: ["CMD", "veddb", "--version"]
  interval: 30s
  timeout: 3s
  retries: 3

⁠Runtime Overview

  • Language: Rust
  • Binary size: ~35MB compressed
  • Protocol: Custom TCP protocol
  • Default port: 50051
  • Storage: Hybrid (in-memory + RocksDB)
  • Metrics port: 9090

GitHub https://github.com/mihir-Rabari/ved-db-server⁠

Issues https://github.com/mihir-Rabari/ved-db-server/issues⁠

Documentation Coming soon

License MIT


⁠Contributing

If you’re interested in databases, storage engines, or Rust performance work, contributions are welcome. Small fixes and deep system work are equally appreciated.

Built in Rust, designed to stay out of your way.

Tag summary

Content type

Image

Digest

sha256:2e6df55a9…

Size

33.9 MB

Last updated

10 months ago

docker pull mihirrabariii/veddb