k.zgara
11/15/2024, 10:52 AMk.zgara
11/15/2024, 11:01 AMfull_consistent
option to get as fresh as possible results. My question mostly points to how to stream changes to SpiceDB and provide strong consistency in certain cases. Cuz let's creating relationship using 2PC refuses the whole idea of streaming changes and why then stream change is the recommended option in SpiceDB documentation? Maybe I'm missing some important detail of implementation using stream commits and someone could point me out to correct way how to deal with consistency. Thanks!vroldanbet
11/15/2024, 11:12 AMgo-workflows
in our project https://github.com/authzed/spicedb-kubeapi-proxy, but there exist many alternatives for other languages. I guess the most popular service in this space would be https://temporal.io/. I like go-workflows
because you don't have to rely on a third-party service, but you use your own database to keep track of the state of the workflow.vroldanbet
11/15/2024, 11:12 AMvroldanbet
11/15/2024, 11:13 AMk.zgara
11/15/2024, 2:55 PMyetitwo
11/15/2024, 5:44 PMvroldanbet
11/15/2024, 5:57 PMvroldanbet
11/15/2024, 6:04 PMtransaction_id=my_transaction_id
- then before redirecting, the frontend calls the backend on an endpoint that blocks by opening a Watch API to SpiceDB, and waits for SpiceDB to emit an event that includes that transaction_id
- the Watch API returns a zedtoken, so your backend can return that zedtoken so that the next redirect does a check with at_least_as_fresh
I think the challenge here is "when to start listening to" in the Watch API, since there could be a race where the event was already emitted and the moment you open Watch API, the event is past.
You could have your backend have a background process always consuming all events from watch API and storing them back in your database.vroldanbet
11/15/2024, 6:31 PMplatform:singleton#transaction@transaction:1234
and wait via the Watch API to listen for it.k.zgara
11/17/2024, 6:50 AM