Safe to store relationship migrations in a table in SpiceDB Postgres? #1895
-
We need to create relationships for thousands of existing database entities and keep track of these relationship migrations. The natural place for this would be in a table in the Postgres DB that SpiceDB uses for entities, since it is "closest to the state". Would it be safe to have a table for this, or is there risk of tables getting clobbered / recreated? I am hesitant to store this "external" state in our primary database (Datomic), because if Spice DB goes away and comes away, primary DB won't know. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can create a table in the SpiceDB schema and it shouldn't be removed, but we do not recommend tinkering with the database as it is an implementation detail, and any behavior may change down the line. I assume you are starting to look into migrating data into SpiceDB. Without more details on the particulars of your business domain, I don't see why you couldn't issue We provide some advice on data migration here: https://authzed.com/blog/writing-relationships-to-spicedb |
Beta Was this translation helpful? Give feedback.
You can create a table in the SpiceDB schema and it shouldn't be removed, but we do not recommend tinkering with the database as it is an implementation detail, and any behavior may change down the line.
I assume you are starting to look into migrating data into SpiceDB. Without more details on the particulars of your business domain, I don't see why you couldn't issue
ReadRelationships
to determine if a row in Datomic has been written to SpiceDB, unless you are unable to uniquely identify a business entity from the relationship stored in SpiceDB.We provide some advice on data migration here: https://authzed.com/blog/writing-relationships-to-spicedb