# S2

> S2 is a serverless API for durable, real-time data streams with SDKs, a CLI, and a self-hostable open-source server.

S2 is a serverless datastore for real-time, streaming data, built by Bandar Systems Inc. Applications append records to named streams and read or tail them over a REST API, a CLI, or SDKs in TypeScript, Python, Go and Rust. An open-source, self-hostable server called s2-lite implements the same API.

## What It Is

S2 treats streams as a cloud storage primitive. The homepage describes it as to moving data what object storage is to static data. Each stream is addressed by a URL: a POST appends records and a GET reads from a sequence number, then tails new records over server-sent events. Records are defined by the user, so the same primitive can carry telemetry, agent messages, events, or state changes.

## Use Cases

The site lists telemetry, agent I/O, event history, agent write-ahead logs, and app sync as production uses. These cover live and historical access to workload telemetry, messages that survive sleeps and dropped connections, replay of captured events, crash recovery by replaying logged state, and keeping clients and services applying the same sequence of changes.

## Self-Hosting with s2-lite

s2-lite is embedded in the CLI as the `s2 lite` subcommand. It is a single-node binary that uses SlateDB and object storage such as AWS S3 or Tigris for durability. It can also run in-memory as an emulator for integration tests, or persist to a local directory. It can be deployed with Docker or a Helm chart for Kubernetes, and exposes `/health` and Prometheus-format `/metrics`. The access-tokens endpoint is not yet supported in s2-lite.

## Performance Tooling

The `s2 bench` command measures acknowledgement and end-to-end latency and throughput against a basin. The homepage states same-region end-to-end p99 latency under 50 ms, up to 100 MiBps write throughput per stream, and unlimited streams with bottomless storage per stream.

## Features
- Append and tail streams over REST with POST and GET
- Server-sent events for following new records
- SDKs for TypeScript, Python, Go and Rust
- Command-line interface with built-in benchmarking (s2 bench)
- Self-hostable s2-lite server backed by SlateDB and object storage
- In-memory mode for use as an S2 emulator in tests
- Helm chart for Kubernetes deployment
- Health and Prometheus metrics endpoints in s2-lite
- OpenAPI and Protobuf specifications
- Web playground and dashboard

## Integrations
AWS S3, Tigris, Cloudflare R2, Kubernetes, Docker, Homebrew, Prometheus, SlateDB

## Platforms
API, CLI, WEB, DEVELOPER_SDK, MACOS, LINUX

## Pricing
Paid

## Links
- Website: https://s2.dev
- Documentation: https://s2.dev/docs
- Repository: https://github.com/s2-streamstore/s2
- EveryDev.ai: https://www.everydev.ai/tools/s2
