Is there a reasonable way to sync identities from ...
# ory-network
r
Is there a reasonable way to sync identities from Ory to my own database? Let’s say I want to build a functionality on my websites that allows either users or admins to find other identities by their name (text search). I’d need to have all my Ory identities synced to some database I own, but I don’t know what the best way would be to sync these identities into my database. Listing all identities via the REST API periodically (e.g. hourly) seems excessive and is not as real-time as I’d like this to be
p
Hi @rough-ghost-22302 You could use webhooks to send the data to your APIs once the user has registered. https://www.ory.sh/docs/kratos/hooks/configure-hooks You can even have the registration fail if the request has failed to reach your API or if your API gave an error.
r
Hey Alano, that’s quite interesting. Just me always worrying about the failure case: if such a websocket request ever fails I have inconsistent/missing data in my users table. How is this typically handled?
p
You can even have the registration fail if the request has failed to reach your API or if your API gave an error.
As i've mentioned, you could have the registration flow error if your api is not reachable, or if something went wrong, e.g. your API gave an error code. This would be imo the best consistency.
r
Ah sorry I missed this, this is great 👍