Ways to migrate schema data

Hi, I am relatively new to dgraph and after going through all the tutorials I’m still a bit confused on whats the best practice for data migration on the database.

I’m not talking about migrating from e.g. mongo/postgress/mysql to dgraph but more so about adding/deleting/renaming predicates or adjusting indexes. I would like to be able to keep track of these migrations I have run and be able to revert if needed. Also when running a migration does this prevent the user from performing reads/writes. If so then I can just do migrations during maintenance hours.

I don’t think we have a schema versioning available, quick way would be to initialise a vcs in your schema repo which can keep track of all your changes.

Indexing takes time. It will run in the background and you can still query the data untouched by this indexing but it will fail for queries which rely on indexed rpedicates. You can rely on the error message to see why it failed.

If you are changing a schema then the read/write should not happen without the new schema in-place.

1 Like