Skip to main content
important

This is a contributors guide and NOT a user guide. Please visit these docs if you are using or evaluating SuperTokens.

DB Table Design

  • 1) If the recipe doesn't create it's own user ID and / or uses userIds from another recipe, then it should not assume that the format of the userId is a UUID. See this issue.
  • 2) If an "object" can semantically mean the same thing across recipes, then extract that into it's own isolated table. For example, a user is semantically the same across thirdparty and emailpassword recipe. ThirdpartyEmailpassword would want to combine the two for counting and pagination purposes. So we should extract them into its own recipe independent table. See this issue.
  • 3) Foreign key constraint must be isolated to be within the tables of a recipe.
  • 4) Store minimal information in a table
  • 5) Indexes should be created based on types of expected queries
  • 6) Table names should be prefixed with the recipe id. For example, if a table called tokens is being created for the session recipe, it must be named session_tokens.
Which frontend SDK do you use?
supertokens-web-js / mobile
supertokens-auth-react