title: Relationship between AWS Cognito User Pool and Identity Pool
body: <p>How are the items in the user pool and the identity pool linked? How can I lookup the Cognito <code>identityId</code> based on Cognito user <code>sub</code>? How can I lookup the Cognito user <code>sub</code> based on Cognito <code>identityId</code>? Also, I currently use the Cognito <code>identityId</code> as user ID for identifying users across my app, should I use <code>sub</code> instead?
  If I want to delete a user due to account cancellation, should I remove the <code>identityId</code> as well?</p>
  
  <p>I use the JavaScript SDK.</p>