S2 is designed to accommodate both infinite accumulation of data, and time-bounded retention. You can use a stream as the long-term source of truth for your data, or as a momentary durable buffer on the way to somewhere else.Documentation Index
Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Age-based retention
A retention policy can be configured on a stream, and S2 will automatically delete records that are older than the configured threshold. This can be set when creating a stream or by reconfiguring an existing one.Records may stay visible for a brief period after their retention window expires, typically on the order of minutes.
Explicit trimming
For more fine-grained control, you can explicitly trim a stream up to a specific sequence number. All records before the trim point will be removed.max(existing_trim_point, min(provided_trim_point, current_tail)), so you can’t trim past the end of the stream, and you can’t move the trim point backwards.
See also
SDK
Stream configuration and trimming
API Reference
Retention policy configuration

