Durable Streams API https://s2.dev
  • Rust 99.3%
  • Shell 0.3%
  • Smarty 0.2%
  • Just 0.1%
Find a file
History 2026-01-16 23:08:20 +02:00
.github/workflows chore: tag Docker image as latest on release (#77) 2026-01-16 23:05:17 +02:00
api chore: updated GH workflow to sync specs submodule (#56) 2026-01-14 23:31:23 -05:00
common shared version for all 3 crates (#44) 2026-01-11 08:46:17 -05:00
lite chore: tag Docker image as latest on release (#77) 2026-01-16 23:05:17 +02:00
.gitignore init 2025-11-07 12:09:00 -08:00
.gitmodules chore: fix submodule sync workflow (#57) 2026-01-14 23:47:18 -05:00
.rustfmt.toml init 2025-11-07 12:09:00 -08:00
AGENTS.md chore: tag Docker image as latest on release (#77) 2026-01-16 23:05:17 +02:00
Cargo.lock release: 0.2.3 2026-01-16 23:08:20 +02:00
Cargo.toml release: 0.2.3 2026-01-16 23:08:20 +02:00
CLAUDE.md s2-lite backend (#11) 2026-01-04 23:37:38 -05:00
justfile feat: add release automation and justfile (#63) 2026-01-15 21:34:46 +02:00
LICENSE init 2025-11-07 12:09:00 -08:00
README.md readme tweaks (#64) 2026-01-15 22:31:04 -05:00

S2, the durable streams API

s2.dev is a serverless datastore for real-time, streaming data.

s2-lite

s2-lite is an open source, self-hostable server implementation of the S2 API.

It uses SlateDB as its storage engine, which relies entirely on object storage for durability.

It is easy to run s2-lite against object stores like AWS S3, GCP GCS, and Cloudflare R2. It is a single-node binary with no other external dependencies. Just like s2.dev, data is always durable on object storage before being acknowledged or returned to readers.

You can also simply not specify a --bucket, which makes it operate entirely in-memory. This is great for integration tests involving S2.

Try it out

TODO: docker run cmd & quickstart

Design

Concepts

  • HTTP API is implemented using axum.
  • Each stream maps to a Tokio task called streamer that owns the current tail position, serializes appends, and broadcasts acknowledged records to followers.
  • Appends are pipelined to improve performance against high-latency object storage.
  • lite::backend::kv::Key documents the data model in sl8.

SlateDB settings

Settings reference

Use SL8_ prefixed environment variables, e.g.:

SL8_FLUSH_INTERVAL=10ms

API Coverage

Tip

Complete specs are available: OpenAPI for the REST-ful core, Protobuf definitions, and S2S which is the streaming session protocol.

Fully supported

  • /basins
  • /streams
  • /streams/{stream}/records

Important

Unlike the cloud service where the basin is implicit as a subdomain, /streams/* requests must specify the basin using the S2-Basin header. The SDKs take care of this automatically.

Not supported

Limitations

Compatibility