I have user’s data which is related to Identity and Access Management (such as name, email, etc.) but we also have user’s data which we need for our product. I have a local database which keeps that data, while I use the user’s userId
to reference the corresponding user in Auth0’s database.
But I’m afraid that over time, due to various errors etc, the data in these two databases can get out of sync, For example:
- Backend gets a Create User request to our Backend service. It creates a user on Auth0 using the management API, then use the
userId
to create a user in our local database. If due to some reason, our local database’s operation fails, we will have a user in our Auth0 database but not in our local database. Now we cannot do a Create User request again with the same user email because our Auth0 management API call will fail since that user already exists.
This is not really an issue with Auth0, however, I would appreciate feedback from more experienced programmers on how to tackle this.