Why tsink?
- Three deployment modes — embed the library directly in your Rust or Python application, run a standalone server binary, or form a replicated cluster. Same engine everywhere.
- Robust engine — segmented WAL with crash-safe sync, LSM-style leveled compaction, adaptive delta/XOR/zstd encoding, mmap zero-copy reads, and configurable memory backpressure.
- Tiered storage — hot, warm, and cold tiers with automatic lifecycle management and optional object-store backing.
- Drop-in protocol support — accepts Prometheus remote write/read, InfluxDB line protocol, OTLP, StatsD, and Graphite out of the box.
- Built-in PromQL — query your data with a native PromQL parser and evaluator. No external query layer needed.
- Secure by default — TLS (rustls, no OpenSSL), RBAC with OIDC, multi-tenant isolation, and mTLS between cluster nodes.
- Zero external dependencies at runtime — single static binary for the server;
protocis vendored at build time.
Deployment modes
Embedded library
Add tsink as a dependency and get a full time-series engine in-process — WAL durability, compaction, retention, and queries included.
use ;
UniFFI bindings expose the core API as a native Python module:
=
=
Server mode
A single binary that speaks every major metrics protocol.
Write data with any client you already have:
# Prometheus text exposition
# PromQL query
Cluster mode
Enable clustering with a flag and scale horizontally. tsink handles shard routing, replication, consistency, hinted handoff, repair, and rebalance automatically.
Storage engine
| Capability | Details |
|---|---|
| Durability | Segmented WAL with configurable sync — per-append (crash-safe) or periodic (throughput-optimized). Strict or salvage replay on recovery. |
| Compaction | LSM-style leveled compaction (L0 → L1 → L2) with tombstone-aware merging and atomic segment replacement. |
| Tiered storage | Automatic hot → warm → cold lifecycle with configurable retention windows. Object-store backing for warm/cold tiers. |
| Encoding | Adaptive timestamp codecs (fixed-step, delta-varint, delta-of-delta), Gorilla XOR float compression, and zstd for persisted segments. |
| Data types | float64, bytes, and native Prometheus histograms. |
| Memory control | Configurable memory budget with admission-based backpressure. Cardinality limits on unique series. |
| Reads | mmap-based zero-copy segment reads. Downsampling, aggregation, and regex-capable label matchers built in. |
Ingestion protocols
| Protocol | Endpoint | Notes |
|---|---|---|
| Prometheus Remote Write | POST /api/v1/write |
Snappy-framed protobuf |
| Prometheus Remote Read | POST /api/v1/read |
|
| Prometheus Text Exposition | POST /api/v1/import/prometheus |
Bulk import |
| InfluxDB Line Protocol | POST /write, POST /api/v2/write |
v1 and v2 compatible |
| OTLP HTTP | POST /v1/metrics |
Protobuf; gauges, sums, histograms, summaries |
| StatsD | UDP (--statsd-listen) |
Counter, gauge, timer, set |
| Graphite | TCP (--graphite-listen) |
Plaintext protocol |
Clustering & replication
- Consistent hash-ring sharding with configurable shard count
- Tunable replication factor and consistency levels (One / Quorum / All) for writes and reads
- Node roles — dedicated Storage, Query, or Hybrid nodes
- Hinted handoff — queues writes for temporarily unavailable replicas
- Digest-based repair — fingerprint exchange detects and resolves inconsistencies
- Online rebalance — pause, resume, and monitor shard migration
- Distributed query fan-out — concurrent shard-aware reads with merge limits
- Cluster-wide snapshots — coordinated data + control-plane backup and restore
- Internal mTLS — dedicated CA for peer-to-peer traffic
Security & multi-tenancy
- TLS — rustls-based with hot-reloadable certificates
- Authentication — bearer tokens (file or exec-based loading), OIDC JWT validation (RS256, HS256)
- RBAC — roles, service accounts with rotation, and live audit logging
- Multi-tenant isolation — per-tenant policies for write rate, query concurrency, admission budgets, and retention
- Secret rotation — runtime rotation of auth tokens, TLS certs, and mTLS materials with overlap grace periods
Operations
/healthzand/ready— Kubernetes-compatible probes/metrics— Prometheus-format self-instrumentation- Recording & alerting rules — built-in rules engine with configurable evaluation intervals
- Rollup policies — persistent downsampled materialization with automated scheduling
- Migration tooling — backfill, verify, and cutover from Prometheus, VictoriaMetrics, InfluxDB, OTLP, StatsD, and Graphite
- Support bundles — bounded JSON diagnostic snapshots per tenant
License
MIT — see LICENSE.