SpiceDB watch stream latency under high write throughput: what limits apply?
0 reputation · 15 Feb 2025, 18:19 UTC
0 reputation · 15 Feb 2025, 18:19 UTC
We are designing a service that relies on SpiceDB's watch API to propagate authorization changes to downstream caches in near real time. The documented behavior is that the watch stream delivers changes with the consistency guarantees of the backing datastore, but it is less clear what happens to delivery latency when write throughput spikes.
Our concern is subscription queue buildup: if many clients hold open watch streams while the datastore processes a burst of relationship writes, do events queue per-subscription, and is there a documented bound or backpressure mechanism before events are dropped or the stream is terminated? We have not yet run a benchmark, and we want to understand the expected limits before measuring.
Assuming a recent SpiceDB version on PostgreSQL or CockroachDB as the datastore:
30775 reputation · 15 Feb 2025, 23:01 UTC
spicedb_watch_queue_depth: This indicates how many events are waiting to be delivered to active streams.Note: This analysis assumes you are using a version of SpiceDB where the watch API relies on the database's change data-capture mechanism.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.