Hello, I have gone through the react quickstart guide and have a good understanding of the concepts for id token, access token, user_metadata and app_metadata. My question though relates specifically to what and where the best way is to store User Profile attributes if they are need in our application logic. I would like to use Auth0 as the canonical data store for the entire users object, and just keep a local reference to a “user_id” in our local postgres database.
Here is an example, let’s say that we have the concept of Users, and they will have attributes such as: Profile Image, Full Name, email, username (unique), country, and timezone. Users are able to create games, let’s just say a game has a title attribute for now.
Users can search for games and the UI will display a results grid of the games with the following columns: game title, Profile Image, User Full name, country, timezone.
How does my server API generate the response in a performant way to collect the users info needed for each game object? The only way I can think of doing it is with a local “shadow” users table that I have to keep in postgres. That would mean I think would need Rules and an API to keep the profile attributes in sync between Auth0 and the pg users table. If I then think about that more I begin to ask why store the profile information in Auth0 at all at that point?
What is the best practice for handling this use case. It seems like it would be fairly common but I can’t seem to find any logical answers. This post talks about using a local users table with two-way user_id links between the local table and the Auth0 users table. That makes sense to me for the user_id, but what about all the other profile attributes?