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.

