Skip to content
Playground Docs

T4

An open-source key-value database built on object storage for durable infrastructure state.

T4 stores infrastructure state locally for fast access and persists WAL segments and checkpoints to S3-compatible object storage for recovery. It includes revisions, watches, leases, transactions, and prefix scans, and it can speak the etcd v3 API when you want to use existing clients and tooling.

Read Why T4 exists for the motivation behind building a key-value database on object storage.

Terminal window
# Install
go install github.com/t4db/t4/cmd/t4@latest
# Start — S3-durable, etcd-compatible
t4 run \
--data-dir /var/lib/t4 \
--listen 0.0.0.0:3379 \
--s3-bucket my-bucket \
--s3-prefix t4/
# Use any etcd v3 client
etcdctl --endpoints=localhost:3379 put /config/timeout 30s
etcdctl --endpoints=localhost:3379 get /config/timeout

Built on object storage

WAL segments and checkpoints are uploaded to S3. A node that loses its disk recovers automatically on next boot — no manual intervention.

Infrastructure primitives

Revisions, watches, leases, transactions, and prefix scans are built in, so T4 can hold config, coordination data, service metadata, and other control-plane state.

Multi-node clustering

Leader election via S3 atomic locks — no Raft, no ZooKeeper, no cluster membership config. Any node can join or leave at any time.

etcd v3 compatible

The standalone binary speaks the etcd v3 gRPC protocol. Drop in for most cases as an etcd replacement — etcdctl, the Go client, and any etcd v3 library work unchanged. See the compatibility guide for the supported subset.

Embeddable Go library

One t4.Open(cfg) call. No sidecar process, no daemon. Run the store inside your binary for zero-overhead local reads.

Zero-copy branching

Fork a database at any checkpoint without copying S3 objects. Shared SSTs are content-addressed and deduplicated automatically.

Prometheus metrics

Built-in /metrics, /healthz, and /readyz endpoints. Drop into your existing observability stack.

Terminal window
go install github.com/t4db/t4/cmd/t4@latest

Or pull the Docker image:

Terminal window
docker pull ghcr.io/t4db/t4:latest
T4etcd
etcd v3 KV + Watch API¹
S3-backed disaster recovery
Survive total disk loss
Embeddable Go library
Zero-copy branching
Consensus protocolS3 atomic locksRaft
Write throughput (8+ concurrent writers)fasterslower
Write throughput (1–4 concurrent writers)slowerfaster
Read throughputequivalentequivalent

¹ T4 implements the KV, Watch, Lease, and Auth services. Status and Defragment return sensible responses. Alarm, Snapshot, Hash, and cluster membership mutations (MemberAdd/Remove) are not supported. See the compatibility guide for details.