Hey guys, I’m just trying Auth0 for the first time and must say that I’m impressed so far.
Still, one thing bothers me quite much, especially when it comes to performance. I would really appreciate some input for inspiration.
Imagine the following.
Users are stored via Auth0 (Regular & Social Logins)
Content for an SPA is stored in an own hosted MongoDb
Imagine a simple Social Network.
1. Scenario 1. do not know how to handle the best way
Users create e.g. Feed posts that in MongoDb easily would contain a ObjectId property defining the post owner. You can then easily populate feed posts with users from the users collection to show their profile image or names. Straight forward.
How would you create the mapping between the not-ObjectId-type users from Auth0 with MongoDb. As a simple string? Then you might miss some MongoDb functionality and it seems a bit unhandy.
2. Scenario 2. do not know how to handle, especially considering performance
Let’s say you want to render 30 feed items. For each feed item you need to either populate the user on server side, which is not possible as the user data is not stored in the MongoDb (Also Auth0 custom databases do not help here because only non-social users go there) or you request each single user from Auth0 afterwards on the client side on rendering the components. Still then you need to provide your API Token to do a request or route it via your server, which creates even more overhead. Or you populate the users by doing requests to Auth0, but that does not seem to be performant either.
So the whole question is about: How do you do performant mappings / populations / joints between Auth0 users and your actual content.