Propose changing the `user_metadata` column type from `text` to `jsonb` in the user_metadata table.

Author: nnnLikCreated Mar 30, 2025Updated Nov 7, 2025
Labelsenhancement

Problem

Currently, the user_metadata column is stored as plain text (TEXT type), which:

  1. Requires parsing/stringifying JSON for every read/write operation. Has worse performance
  2. Doesn't provide native JSON validation at the database level

Solution

Changing the column type to jsonb would:

  1. Provide native JSON support in PostgreSQL (As I know, mysql also supports json since v5.7)
  2. Enable more efficient querying of nested metadata fields
  3. Allow indexing specific metadata fields if needed

Source: supertokens/supertokens-core