Skip to content

vibesrc/tiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiz

Embeddable timeseries database with a Rust core, CLI shell, and server.

Features

  • Columnar, append-only segments with per-table chunk + TTL.
  • Single-file WAL with rotation and replay.
  • SQL-ish query language with time expressions and windowing.
  • Tag predicates with LIKE/ILIKE/starts_with/contains.
  • Influx line protocol ingest (HTTP + TCP).

Build

cargo build

CLI

Start the shell:

cargo run -p tiz --

Run a single query:

cargo run -p tiz -- -c "SELECT avg(*) FROM sys WHERE ts BETWEEN now(1h) AND now() GROUP BY time('1m')"

Server

Run the server:

cargo run -p tiz-server

HTTP endpoints:

  • POST /ingest JSON rows
  • GET /query?q=...
  • GET /query/stream?q=... (SSE)
  • POST /write Influx line protocol

Config

Defaults live in tiz.toml. You can override with env vars using double-underscore nesting, for example:

TIZ__STORAGE__DATA_DIR=/var/lib/tiz \
TIZ__WAL__ROTATION_INTERVAL_MS=1000 \
TIZ__MEMTABLE__FLUSH_MAX_POINTS=50000 \
TIZ__AUTH__TOKEN=secret \
cargo run -p tiz-server

Example schema

CREATE TABLE sys (
  ts TIMESTAMP,
  cpu_pct FLOAT,
  mem_gb FLOAT,
  region STRING CODEC dict
) WITH (chunk='10s', ttl='60s');

Example ingest

INSERT INTO sys (ts, cpu_pct, mem_gb, region)
VALUES (now(), 42.0, 3.1, 'us-east');

Line protocol:

curl -X POST http://127.0.0.1:8181/write \
  --data-binary "sys,region=us-east cpu_pct=0.82,mem_gb=4.1 1736342140000000000"

Docker

docker build -t tiz .
docker run --rm -p 8181:8181 -p 8182:8182 tiz

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages