I have an authenticated user in AWS Cognito service and want to store his unique identifier in the database. Should I store user\'s username (it\'s his phone number) or his \"su
If you only want to store one, the sub is probably the way to go for the reasons you provided.
It depends greatly on your use case, but if you need to use this database to call APIs like your example, keeping track of both/a mapping between the two is a totally valid solution.