shikhar

@schmizz.net

Making streams serverless @s2.dev

You can now use S2 as a backend for Mastra Durable Agents! The @ s2-dev/mastra-pubsub adapter maps each durable topic to an S2 stream, with live delivery, replay after refreshes or process restarts, and distributed leases for coordinating thread ownership across processes.

Bild

What if your brain could be a pet? @anthropic.com have shared the benefits of decoupling the brain from its hands. We have also written about using a stream per agent session as a WAL and what that unlocks. If it seems complicated, it is. And durable execution frameworks are far too intrusive.

S2 source and sink plugins are now available for Streamling. Read durable S2 streams into Arrow batches, or write Streamling output back to S2. ClickHouse ingestion, Postgres CDC, and a full Postgres → S2 → ClickHouse example: s2.dev/docs/integr...

Bild

Serverless gets clowned on sometimes (ha ha, there are servers) but is ultimately about pricing usage and not having to provision resources you don't use, or think about such things as "clusters". It is genuinely hard for stateful services, but I don't think there is a better DevX.

turns out "stream per session" is not just for agents. it works for browser sessions too. built RePlaya, a self-hosted session replay tool where each visit is just an @s2.dev stream you can play back or tail live. recording = append playback = read live replay = tail github.com/s2-streamsto...

On the retirement of S2's gRPC API, realized how to describe our current API: REST-first. REST undersells, it supports append & read sessions over HTTP/2 similar to gRPC. We'll do HTTP/3 too when the ecosystem is ready.

maybe it's not too surprising plaintext can be competitive with vector dbs when you consider agents effectively do semantic grep by query expansion

There's two new ways to manage S2 as code! The Terraform provider lets you manage resources with full lifecycle support. Available on the Terraform Registry at s2-streamstore/s2. Or you can use the CLI by `s2 apply` which takes a declarative JSON spec and creates/reconfigures specified resources.

The s2.dev dashboard now has a Data Plane studio to make it convenient to work with streams. You can: -Do one-shot reads, live tail from any stream, start from an offset, seq no., or timestamp -Append records in multiple modes -Run stream commands -Inspect records with command record aware rendering