#Dublicate writes are not discarded
1 messages · Page 1 of 1 (latest)
Hi @amber compass , Permify applies the MVCC (Multi Version Concurrency Control) pattern for Postgres, creating a separate database snapshot for each write and delete operation.
https://mbukowicz.github.io/databases/2020/05/01/snapshot-isolation-in-postgresql.html
So delete operations (such as DeleteAPI) deletes relationships softly. Soft deleted relationships remains recorded in the database unless you dont remove them with using garbage collector:
database:
…
…
garbage_collection:
enabled: true
interval: 200h
window: 200h
timeout: 5m
But these relationships is not visible during queries, except you dont specify the older snapshots.
If the data hasn't been deleted, the expired_id is set to 0.
Oh it makes sense to have a garbage collector for snapshots. That's good to know.
I was also wondering, when I remove a relation from the data, does the garbage collector also cleanup that data? My guess would be yes
Yes indeed, its worth mentioning that the garbage collector deletes older snapshots within a given time period.