Watch api
# spicedb
n
We are replicating SpiceDB relations to Apache Pulsar via the watch api. In case of a tech issue during the weekend, we would like to have enough time to fix it without having any data loss. Is it ok to set
datastore-gc-window
to, for example, 7 days? Also, the watch api accepts a ZedToken, but if you don't provide one, then it will watch from the current state. Is it possible to stream from the beginning, e.g. by initializing the ZedToken to some static start token? We will deploy SpiceDB and the replicator at roughly the same time, but it would be nice if we didn't need to guarantee that no relations are published before we deploy the Apache Pulsar replicator.
v
- gc window: depends on your datastore. CRDB does not recommend more than 24h. Not sure for Spanner. Postgres: means data and indexes grow, queries may get slower, may depend on your setup. Watch API streaming from the beginning: please open an issue
n
We run Postgres on GCP CloudSQL
j
the datastore gc window basically works the same on all datastores: all of the old copies of data in the datastore are kept around until they expire. If you have a workload with a lot of in-place mutations, or just generatelly a write workload that involves deletes, performance will suffer. For some datastores, the versions of a primary key must be searched linearly the farther you go in the past. We've experienced poor performance with touch heavy workloads in the past with longer GC windows, but I believe that was before touch was changed to be a true upsert.
n
Thanks. I will increase the gc window and will keep an eye on performance
31 Views