Skip to content
/ tau Public

An immutable, append-only, event-sourced temporal database built in Zig

License

Notifications You must be signed in to change notification settings

taudb/tau

Repository files navigation

τ (tau)

An immutable, append-only, event-sourced temporal database built in Zig

Prerelease Software: This project is in active development on the next branch. Expect breaking changes. Stable releases will be published to master when ready.

  █████                        
 ░░███                         
 ███████    ██████   █████ ████
░░░███░    ░░░░░███ ░░███ ░███ 
  ░███      ███████  ░███ ░███ 
  ░███ ███ ███░░███  ░███ ░███ 
  ░░█████ ░░████████ ░░████████
   ░░░░░   ░░░░░░░░   ░░░░░░░░ 

Prerequisites

  • Zig 0.15.2 or later

Quick Start

Install (prebuilt binaries)

Note: Prebuilt binaries are only available for stable releases on master. During the prerelease phase, please build from source.

Once stable releases are available, use the installer script with integrity verification:

curl -fsSL https://raw.githubusercontent.com/taudb/tau/master/install.sh | bash
# or install to user path (no sudo):
TAU_INSTALL_DIR="$HOME/.local/bin" curl -fsSL https://raw.githubusercontent.com/taudb/tau/master/install.sh | bash

Manual: download an artifact from the latest GitHub Release and verify against SHA256SUMS, then place tau and tau-repl into a directory on your PATH.

Build from source

  1. Clone and build:

    git clone https://github.com/taudb/tau.git
    cd tau
    zig build
  2. Run the server:

    # Default: InMemory backend (fast, non-persistent)
    zig build run-server
    
    # File backend (persistent, slower)
    TAU_BACKEND_TYPE=File TAU_DATA_DIR=./tau_data zig build run-server
  3. Run the REPL client:

    zig build run-repl

Storage Backends

Tau supports multiple storage backends for different use cases:

InMemory Backend (Default)

  • Performance: ~97 μs writes, ~77 μs reads, ~89 μs concurrent writes
  • Use case: Development, testing, high-performance scenarios
  • Durability: Data lost on restart
  • Configuration: TAU_BACKEND_TYPE=InMemory

File Backend

  • Performance: ~37 ms writes, ~138 μs reads, ~29 ms concurrent writes
  • Use case: Production, persistent storage
  • Durability: Data persists across restarts with WAL
  • Configuration:
    TAU_BACKEND_TYPE=File
    TAU_DATA_DIR=./tau_data

Inspecting File Backend Data

You can inspect the raw file backend data using standard Unix tools:

# View file structure
ls -la tau_data/

# Inspect data files with hexdump
xxd tau_data/some_key.dat | head -20

# View WAL (Write-Ahead Log) files
xxd tau_data/wal.log | head -20

Building

# Build all executables
zig build

# Build with optimizations
zig build -Drelease-safe
zig build -Drelease-fast

Testing

# Run all tests
zig build test

# Run only library tests
zig build test-libtau

# Run only server tests
zig build test-server

# Run all benchmarks
zig build bench

# Run only library benchmarks
zig build bench-libtau

# Run only server benchmarks
zig build bench-server

Releases

This project uses a two-branch release strategy:

Branch Purpose Version Format Example
next Development prereleases X.Y.Z-dev.N 0.1.0-dev.1
master Stable releases X.Y.Z 1.0.0
  • Prerelease artifacts (next branch): Published as GitHub prereleases with -dev.N suffix. Use for testing new features.
  • Stable artifacts (master branch): Published as full GitHub releases. Use for production.
  • Release artifacts are published for: linux-x86_64-musl, linux-aarch64-musl, macos-arm64.
  • Integrity: SHA256 checksums (SHA256SUMS) accompany each release and are verified by install.sh.
  • Versioning: automated SemVer via Conventional Commits with semantic-release.
  • Release Notes & Changelog: generated from commit messages; see CHANGELOG.md and GitHub Releases.

Benchmarks

Benchmarks are available via zig build bench. Results vary by environment (CPU, disk, OS). Do not compare numbers without describing the environment. The project does not publish canonical benchmark figures.

Development

Code Formatting

zig fmt libtau/ server/ repl/

Syntax Checking

zig ast-check server/main.zig
zig ast-check libtau/primitives/tau.zig

License

  • License: PolyForm Noncommercial 1.0.0
  • Noncommercial use only. Commercial licensing available from the author.
  • Contact: adamrbyrne@gmail.com

About

An immutable, append-only, event-sourced temporal database built in Zig

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages