0

I’m starting to learn AWS serverless and react native. My plan currently is to authenticate a user with cognito, then add a on boarding part where you can add your age, full name etc. This will then be posted to dynamodb as a user. I was then thinking how to best pull the current user from the user database. My first thought was to maybe store a random userId in asyncstorage and call the user from dynamodb depending on the Id stored. My second thought was to do a post confirmation lambda from cognito that would user the cognito userId as a Id for the user database and just call a user based on the id. Or my last option was to somehow attach the cognito userId to a graphql resolver that I post to create the user initially in the database. I am new to all this so any guidance or help for what the best practice is would be great. I don’t have any code for it at the moment as I am trying to decide the best way forward!

Oliver Darby
  • 454
  • 1
  • 6
  • 15
  • And you don't want to store that data in Cognito directly with your user because? – Aleksander Wons Apr 08 '21 at 13:29
  • I thought the same thing but I think my object would be getting very large and I don’t know the latency of using cognito as a user database. I also saw on similar answers of people suggesting it was common practice not to. So I just assumed - but any advice else wise is more than welcome – Oliver Darby Apr 09 '21 at 14:16

0 Answers0