A Dead SimpleGTSDB
Golang Time Series Data Base

TimeSeries DataBase that is…

Docker· Binary· Windows· Linux / BSD· macOS

GTSDB - Durable and Memory Friendly timeseries database | Product Hunt
GTSDB Illustration

Key features

Blazing Fast

96M ops/sec multi-key read. 1.22M ops/sec batch write. Binary protocol + Velox JSON.

Memory Efficient

As low as 6 MB memory. Perfect for IoT edge devices.

Simple API

Identical HTTP + TCP interfaces, all in strict JSON.

Gorilla Compression

29.6× smaller than JSON. Massive disk savings.

Built-in Streaming

Subscribe to keys, receive updates in real-time.

Battle-Tested

Production use by IoT pioneers. Full code coverage.

Batch Write

Up to 10,000 points per call. Bulk imports.

Advanced Analytics

Downsampling: avg, sum, min, max, p50, p95, p99.

Monitoring Ready

Built-in /health and /metrics (Prometheus) endpoints.

Why is GTSDB so efficient?

A deep dive into the architecture that makes GTSDB fast, small, and durable.

Most databases separate their write path and read path with layers of abstraction — a write-ahead log (WAL) for durability, a buffer pool for caching, and separate index structures for querying. Each layer adds latency and memory overhead. GTSDB takes a fundamentally different approach: the WAL is the database.

Instead of maintaining a separate buffer pool and periodically flushing pages to disk, GTSDB appends every write directly to a per-key append-only file. There is no double-writing — data goes straight from the network socket to the WAL and into a ring buffer cache. This eliminates the memory amplification that comes from maintaining both a write buffer and a read cache. The ring buffer, configured per-key with up to 10,000 slots, serves recent reads directly from memory without any disk access. For a typical IoT workload where the latest readings matter most, virtually every read hits the cache.

But the real performance breakthrough is in how GTSDB handles the read path. Traditional databases serialize query results into verbose JSON, with each data point carrying repeated field names like "timestamp" and "value". At 5,000 points per query, this adds up to hundreds of kilobytes of redundant text. GTSDB introduces an optional binary protocol: each data point becomes a fixed 16-byte record — an 8-byte timestamp followed by an 8-byte IEEE 754 float. No parsing, no field name repetition, no reflection-based serialization overhead. The server writes raw bytes straight to the TCP socket; the client reads them back with zero allocation. On a multi-key read of 25,000 points, this alone takes the response time from 7 milliseconds down to 260 microseconds.

The JSON path is no slouch either. GTSDB uses Velox, a Go JSON library backed by a native C VM, which outperforms the standard library by an order of magnitude and even beats SIMD-based alternatives like Sonic. For writes and non-bulk reads where JSON remains the default, Velox handles marshaling in nanoseconds per operation.

Under the hood, a dirty-key async flusher ensures that only modified keys trigger disk syncs, avoiding the blanket fsync storms that plague append-only databases. When data does go to disk, Facebook's Gorilla time-series compression reduces storage by nearly 30x compared to raw JSON, making disk space a non-issue even on constrained edge devices.

The architecture scales down as well as it scales up. At idle, GTSDB uses about 6 MB of memory — less than a single browser tab. It ships as a single statically-linked binary with no external dependencies. Deploy it on a Raspberry Pi, a cloud VM, or a Windows server; the behavior is identical. This is what makes GTSDB uniquely suited for IoT: it does not ask you to choose between durability, speed, and footprint. It gives you all three.

Usages


POST /
{
    "operation": "write",
    "key": "a_sensor1",
    "write": {
        "value": 32242424243333333333.3333
    }
}
                      

Need more details? Check out our complete API documentation.

View Full API Documentation

Client Drivers

First-class Go & Node.js clients with JSON and binary protocol support

Gov0.1.0
go get github.com/abbychau/gtsdb-drivers/go@latest
import "github.com/abbychau/gtsdb-drivers/go"

client, _ := gtsdb.Connect("localhost:5555")
client.Auth("your-token")

// JSON
client.Write("sensor1", 42.5)
pts, _ := client.ReadLast("sensor1", 100)

// 🚀 Binary – 100x faster
pts, _ := client.ReadBinary("sensor1", 5000)
multi, _ := client.MultiReadBinary(
    []string{"s1","s2"}, 5000,
)
Go driver + docs
Node.jsv0.1.0
npm install github:abbychau/gtsdb-drivers
const { GTSDBClient } = require('gtsdb-drivers')
const c = new GTSDBClient('localhost', 5555)
await c.connect()
await c.auth('your-token')

// JSON
await c.write('sensor1', 42.5)
const pts = await c.readLast('sensor1', 100)

// 🚀 Binary – 100x faster
const pts = await c.readBinary('sensor1', 5000)
const multi = await c.multiReadBinary(
  ['s1','s2'], 5000
)
JS driver + docs

Performance Comparison

Benchmarked against VictoriaMetrics v1.147, InfluxDB v2.9, and NSQ v1.3 on Windows / i7-13700KF / 5,000 points per operation. Reads use binary protocol.

Write Benchmarks

Write (seq) – 5,000 pts

Batch Write – 5,000 pts

Pipeline Write – 5,000 pts

Multi-Sensor Write – 5 keys × 1,000 pts

Read Benchmarks

Single Read – Last 1 Point

Multi-Key Read – 5 Keys × 5,000 pts

Pub/Sub Delivery Latency (s)

Storage per 5,000 points (KB)

Resource Usage

CPU Time (s)

Memory (MB)

Disk (KB)

Benchmark Report Charts

Radar Chart
Click to enlarge

Performance Radar

Ops/Sec
Click to enlarge

Throughput (ops/sec)

Resource Usage
Click to enlarge

Resource Usage

Write Latency
Click to enlarge

Write Latency

Batch Write
Click to enlarge

Batch Write Comparison

Pipeline Write
Click to enlarge

Pipeline Write

Read Comparison
Click to enlarge

Read Comparison

Multi Write
Click to enlarge

Multi-Sensor Write

Test Configuration

Points per Operation5,000
Sensors (multi-write)5
Runs per Benchmark3
Warmup Iterations300
GTSDB JSON LibraryVelox (native C VM backend)
GTSDB Cache Size10,000 ring buffer / key
Sync Modeasync (dirty-key flusher)
(p.s. sync mode also available, and our clients love it :p)
OSWindows
Architectureamd64
CPUCore(TM) i7-13700KF

Key Takeaways

vs InfluxDB

  • 16.21x faster sequential write (90.97 ms vs 1474.15 ms)
  • 9.21x faster pipeline write (29.4 ms vs 270.71 ms)
  • 4.59x faster batch write (2.29 ms vs 10.52 ms)
  • 3.56x faster multi-sensor write (2.37 ms vs 8.46 ms)
  • 44.27x faster single read (<0.19 ms vs 8.35 ms)
  • 18.13x faster multi-key read (0.72 ms vs 13.09 ms)

vs VictoriaMetrics

  • 1.73x faster sequential write (90.97 ms vs 156.98 ms)
  • 1.2x faster pipeline write (29.4 ms vs 35.19 ms)
  • 3.55x faster multi-key read (0.72 ms vs 0.2 ms) 🏆
  • 2.27x faster single read (0.19 ms vs 0.08 ms) 🏆
  • VM leads batch write (2.46x) and multi-write (3.84x)

General

  • JSON: Velox native C VM + binary protocol for reads
  • Binary protocol: 16 bytes/point, zero-alloc encode/decode
  • Multi-Key Read: 6,926,359 ops/sec – faster than VM
  • Pub/Sub: 110.94 ms delivery latency
  • 2,183,177 ops/sec batch write, 2,107,641 ops/sec multi-write
  • 29.6x smaller than raw JSON with Gorilla compression
  • Only ~12 MB memory usage at idle
  • Single binary executable – no dependencies

Trusted By

ControlFreeVertriqeJeju Samdasoo

Ready to Get Started?

Download GTSDB