permify icon indicating copy to clipboard operation
permify copied to clipboard

support cockroachdb + yugabytedb as additional engine support

Open paulm17 opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. This is a feature.

Postgres is a great database, however it's a SPOF. Both cockroachdb and yugabyte are solutions for this issue.

Unfortunately neither support xid8 type.

I do see that SpiceDB (to support cockroachdb) uses a normal timestamp to sidestep this issue.

Describe the solution you'd like

Would be awesome if both cockroachdb and yugabyte are supported to give others options. Looking at the migration files, once one is completed. It's a copy and paste for the other.

Additional context

Would the work entail?

  1. Creating a new folder in the internal / storage directory with migrations tailored for another database.
  2. Changing migration.go to support the other engines.
  3. Changing the database interactivity insert/update/delete to support the other engines?

I suspect it could be a minimal change, due to both databases mimic a postgres connection?

Thanks!

paulm17 avatar Mar 02 '24 12:03 paulm17

I had a bit of free time yesterday to finalise this for myself. I now have Yugabyte working with permify.

https://github.com/paulm17/permify

I've added [yugabyte] as a new engine and have found the relevant functions and types (that required minimum 12/13) for version 11. Hopefully this won't cause any unnecessary conflicts or issues.

Eventually Yugabyte will upgrade to 15: https://github.com/yugabyte/yugabyte-db/issues/9797

paulm17 avatar May 16 '24 12:05 paulm17