How to bootstrap SpiceDB's datastore when migrating from another auth system to AuthZed? #1585
-
Our application currently stores data models used for making authz decisions in couple of tables. In order to migrate to AuthZed, we need to bootstrap the relationship data from some existing data (a few million relationship tuples). What's the best way of doing so? I see a couple of options:
Or there might be some other ways. Any suggestions are welcome! |
Beta Was this translation helpful? Give feedback.
Answered by
vroldanbet
Oct 17, 2023
Replies: 1 comment
-
Hi @andyren0110 👋🏻
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
vroldanbet
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @andyren0110 👋🏻
BulkImport
API is the recommended way. It leverages the bulk loading features on the underlying databases, the most efficient way to load large chunks of data. It exposes a bidirectional gRPC streaming API, so you can even parallelize data loading. We've seen this be able to ingest very quickly into Postgres instances. You can also run bulk import usingzed
CLIzed relationship create/touch
command, which supports reading from STDIN, so you can have a script that generates the relationships and pipe it intozed
. This comes with all the datastore's transaction ACID overhead, so it would be slower, but has the nicety that it can be imp…