v0.3.0 — Built in Koder Lang

One database.
Eight models.

Store your data once, query it any way you need. Object, relational, document, graph, time-series, key-value, vector, and log — all in a single, unified engine.

Get Started Explore Models

Eight Data Models, One Engine

Every model operates over the same LSM-tree storage engine. An object can be queried as a row, projected as a document, traversed as a graph node, searched as a vector, or aggregated as a log stream.

Object-Oriented

Persist Koder Lang objects directly — no ORM, no impedance mismatch. Classes map to storage with inheritance, references, and polymorphism preserved.

zero-ORMinheritancepolymorphic queries

Relational

Full SQL-compatible interface with tables, joins, constraints, views, materialized views, CTEs, and window functions.

SQLjoinsACIDviews

Document

Schema-flexible JSON documents with nested field access, array operations, aggregation pipelines, and optional schema enforcement.

JSONschema-lesspipelines

Graph

First-class nodes and edges with BFS/DFS traversals, Dijkstra shortest path, PageRank, community detection, and cycle detection.

traversalsPageRankshortest path

Time-Series

Hypertables with automatic chunking, retention policies, continuous aggregates, downsampling, and InfluxDB line protocol compatibility.

hypertablesaggregatesretention

Key-Value

Rich data structures — lists, sets, sorted sets, hashes, streams — with TTL expiration, pub/sub messaging, and atomic operations.

structuresTTLpub/sub

Vector

HNSW index for approximate nearest neighbor search with cosine, euclidean, dot-product, and manhattan distance metrics. Hybrid search with metadata filters.

HNSWcosinehybrid search

Log

Unified log aggregation with LogQL query language (Grafana Loki compatible), multi-stage pipelines, live tail, alerting, syslog receiver, and full-text search via trigram indexing.

LogQLLoki-compatiblelive tailpipelines

Zero-ORM Object Persistence

Define a class in Koder Lang and persist it directly. No mapping files, no schema migrations, no boilerplate.

  • Classes map to storage naturally
  • Inheritance and references preserved
  • Polymorphic queries across class hierarchies
  • Lazy loading of object references
# Define a class and persist it — zero ORM
class User
  attr_accessor :name, :email, :age
  def initialize(name, email, age)
    @name = name
    @email = email
    @age = age
  end
end

user = User.new("Alice", "alice@koder.dev", 30)
db.object.store(user)

# Query with Koder Lang syntax
adults = db.object.query("User") { |u|
  u.age > 18 && u.email.end_with?("@koder.dev")
}

KQL — Unified Query Language

One query language that spans all eight models. SQL-compatible with extensions for graph traversals, time-series bucketing, vector search, and LogQL translation.

  • SQL-compatible for relational queries
  • TRAVERSE for graph traversals
  • TIME_BUCKET for time-series aggregation
  • SIMILAR_TO for vector search
-- Relational
SELECT name, AVG(salary) OVER (PARTITION BY dept)
FROM employees WHERE active = true;

-- Graph traversal
TRAVERSE OUTBOUND 'alice' EDGE follows MAX 3
WHERE age > 25 RETURN name;

-- Time-series bucketing
TIME_BUCKET metrics INTERVAL 3600
AGGREGATE avg_cpu = AVG(cpu)
GROUP BY host FILL zero;

-- Vector similarity search
SELECT * FROM embeddings
SIMILAR_TO [0.1, 0.2, 0.3] KNN 10;

HTTP API + Real-Time

Full REST API for all models, plus WebSocket for live queries and change data capture. GraphQL auto-generated from your schema.

  • REST endpoints for every model
  • WebSocket live queries and CDC
  • GraphQL with auto-generated schema
  • InfluxDB line protocol for time-series
# Insert a document
curl -X POST https://db.koder.dev/api/v1/\
collections/posts/documents \
  -H 'Content-Type: application/json' \
  -d '{"title":"Hello","body":"World"}'

# Vector search
curl -X POST https://db.koder.dev/api/v1/\
vectors/embeddings/search \
  -d '{"vector":[0.1,0.2,0.3],"k":10}'

# Live query via WebSocket
{"type":"live",
 "query":"SELECT * FROM users"}

Log Aggregation + LogQL

Push logs from any source and query them with LogQL — fully compatible with Grafana Loki. Live tail, alerting, and multi-stage pipelines built in.

  • LogQL query language (Loki-compatible)
  • JSON, NDJSON, and syslog ingestion
  • Live tail via WebSocket
  • Pattern, threshold, and rate alerting
  • Trigram index for fast full-text search
  • koder-trace agent integration
# Push logs via CLI
echo "Hello World" | kdb log push \
  --labels "job=test"

# Query logs with LogQL
kdb log query '{job="test"} |= "error"'

# Live tail
kdb log tail '{job="test"}'

# Push via Loki-compatible API
curl -X POST https://db.koder.dev/loki/api/v1/push \
  -H 'Content-Type: application/json' \
  -d '{"streams":[{"stream":{"job":"app"},
    "values":[["1679000000000","log line"]]}]}'

# Range aggregation
kdb log query 'rate({job="app"}[5m])'

Built for Production

Every feature you need from a modern database, designed from the ground up.

LSM-Tree Storage

MemTable, WAL, SSTables with bloom filters, leveled compaction. Optimized for both reads and writes.

ACID Transactions

Serializable isolation with MVCC. Deadlock detection, savepoints, and two-phase commit for distributed transactions.

Multiple Indexes

B-tree, Hash, R-tree (geospatial), HNSW (vector). Automatic index selection by the query planner.

Distributed

Raft consensus for leader election and log replication. Consistent hashing with virtual nodes for sharding.

🔒
Security

JWT authentication, API keys, RBAC, row-level security policies. Encryption at rest and in transit.

Real-Time

Live queries, change data capture, WebSocket streaming, and pub/sub messaging built into the core.

💾
Backup & Recovery

Full and incremental backups with zstd compression. Point-in-time recovery via WAL replay.

📈
Monitoring

Prometheus-compatible metrics, slow query log, audit logging, and health checks out of the box.

💻
Server-Side Scripting

Stored procedures, triggers, and scheduled tasks written in Koder Lang, executing inside the database.

📦
Embeddable

Use as a standalone server or embed directly into your Koder Lang application as a library. Zero external dependencies.

🌐
Multi-Protocol

HTTP/REST, WebSocket, GraphQL, and wire protocol. InfluxDB line protocol for time-series ingestion.

🛠
Admin Dashboard

Built-in web UI with query editor, data browser, graph visualizer, and real-time statistics.

📜
Log Aggregation

LogQL query language (Grafana Loki compatible), multi-stage processing pipelines, live tail via WebSocket, pattern/threshold alerting, syslog receiver.

🔭
Koder Trace Integration

Centralized agent registry, remote configuration, network health diagnostics ingestion, and .ktrace file import for distributed monitoring.

Architecture

Clean layered design where each component does one thing well.

Clients
CLI (kdb) · HTTP/REST · WebSocket · GraphQL · Desktop · Mobile
KQL Query Engine
Lexer → Parser → Planner → Executor
Data Models
Object · Relational · Document · Graph · Time-Series · Key-Value · Vector · Log
Transaction Manager
MVCC · Lock Manager · 2PC · Savepoints · Deadlock Detection
Index Engine
B-tree · Hash · R-tree · GIN · HNSW · BRIN
Storage Engine (LSM-tree)
MemTable → WAL → SSTable → Compaction · Bloom Filter · Compression
Replication
Raft Consensus · Consistent Hashing · Geo-Partitioning

How It Compares

Koder DB combines the best features from 25+ open-source databases.

Feature Koder DB PostgreSQL MongoDB Neo4j Redis InfluxDB
Relational
DocumentPartial
Graph
Time-SeriesExtension
Key-Value
Vector SearchExtensionAtlas
Object-Oriented
Log Aggregation
Live QueriesLISTENStreamsPub/Sub
Embeddable
GraphQL API

Ready to simplify your data layer?

One database. Eight models. Zero compromises.

Download v0.3.0 View Source