streamstack
streamstack copied to clipboard
[feature] Auto-balance streams across nodes
Streams are sticky to the node that owns them. If a node gets hot or we add new nodes to the cluster, nothing moves. Rebalancing today is a manual process.
Since the data itself lives in object storage, moving a stream should mostly be a metadata handoff, so this is feasible as opposed to disk-based systems.
Proposal:
- A balancer/auto-scaler that watches per-node load (stream count, throughput, maybe cache pressure) and moves ownership when things get skewed
- Automatic redistribution when a new node joins.
- Graceful handoff: seal in-flight writes, transfer ownership in metadata, redirect clients
Pico now supports slots as a construct for each node, for better distribution of streams across nodes.
It's currently count based, which can later extend to metric based measures.