- Rust 99.3%
- Shell 0.3%
- Smarty 0.2%
- Just 0.1%
|
History
|
||
|---|---|---|
| .github/workflows | ||
| api | ||
| common | ||
| lite | ||
| .gitignore | ||
| .gitmodules | ||
| .rustfmt.toml | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| justfile | ||
| LICENSE | ||
| README.md | ||
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
- HTTP API is implemented using axum.
- Each stream maps to a Tokio task called
streamerthat 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::Keydocuments the data model in sl8.
SlateDB settings
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 theS2-Basinheader. The SDKs take care of this automatically.
Not supported
/access-tokenshttps://github.com/s2-streamstore/s2/issues/28/metrics
Limitations
- Deletion is not fully plumbed up yet
- Pipelining needs to be made safe and default https://github.com/s2-streamstore/s2/issues/48
Compatibility