Skip to content

oshaulz/glen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glen

An embedded document database for Nim with first-class spatial, temporal, and numeric primitives — durable, concurrent, in-process.

import glen/db, glen/types

let db = newGlenDB("./mydb")
var alice = VObject()
alice["name"] = VString("Alice")
db.put("users", "u1", alice)
echo db.get("users", "u1")

Status: beta (0.5.0). On-disk formats are versioned (WAL v2; snapshot v3 with v1/v2 read-back; GRI/GPI v1; GTS/TTS v1). Expect minor API churn until 1.0.

What's inside

Core Document model + WAL + snapshots, optimistic transactions, sharded LRU cache, striped per-collection RW-locks, multi-master replication (HLC, LWW), schema validation
Spatial R-tree indexes for points and polygons, KNN with planar or geographic (haversine) metrics, point-in-polygon queries
Temporal Gorilla-encoded scalar time-series engine; tile time-stacks for compressed raster-over-time storage
Numeric Vector + Matrix primitives, GeoMesh (raster pinned to a bbox)
Scale Spillable mode with paged on-disk doc index — datasets bigger than RAM via mmap; streaming iterators for bounded-memory bulk reads

No external runtime dependencies. Pure Nim ≥ 1.6.

Install

nimble install https://github.com/oshaulz/glen

or in a .nimble file:

requires "https://github.com/oshaulz/glen >= 0.5.0"

Documentation

Start here:

Topical:

API reference:

  • Coredb.put / get / delete, batch ops, transactions, equality / range indexes, subscriptions, replication, schema validation
  • Spatial — geo points (R-tree), polygons, GeoMesh
  • Time-series — Gorilla TSDB, tile time-stacks
  • NumericVector, Matrix, ops

For an architectural deep-dive, see WHITEPAPER.md. For agent / contributor guidance, see AGENT_GUIDE.md.

License

MIT. See LICENSE.

About

Embedded document database for Nim with built-in spatial, time-series, and numeric primitives. Designed for low-latency in-process workloads from edge devices to single-node analytics

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages