spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Implement support for metadata associated with read-write transactions

Open josephschorr opened this issue 1 year ago • 5 comments

This will allow callers of APIs such as WriteRelationships and DeleteRelationships to assign metadata to the transaction that will be mirrored back out in the Watch API, to provide a means for correlating updates

First part of #966

Each datastore has a different means of correlating between the transaction and the associated change(s) coming out of the watch API:

  • Memdb: The metadata is stored on the changes struct
  • Postgres: A metadata column was added to the transactions table
  • MySQL: A metadata column was added to the transactions table
  • Spanner: A transaction tag is used to correlate the transaction and the metadata is stored in an auto-GC-ing table, indexed by the transaction tag
  • CRDB: A row is inserted into a metadata table as part of the transaction, which includes the metadata. When seen at the same revision as the other changes, the metadata becomes correlated with that transaction. The rows are set to auto-GC after a period of time in CRDB >= v22

josephschorr avatar May 26 '24 23:05 josephschorr

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar May 26 '24 23:05 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

josephschorr avatar May 26 '24 23:05 josephschorr

recheck

josephschorr avatar May 26 '24 23:05 josephschorr

Updated

josephschorr avatar Jun 01 '24 22:06 josephschorr

Rebased

josephschorr avatar Aug 26 '24 17:08 josephschorr