When to Use a Separate User Database

Last Updated: Oct 2, 2024

Overview

This article covers when to use a separate user database.

Solution

While it’s usually preferable to keep data within Auth0, in some cases it can be advantageous or even necessary to use a separate database.

When using a separate database it’s recommended to associate the external user profile with the user_id of the Auth0 user.

Reasons to use a separate database:

  • When complex schemas with heavily nested attributes are required
  • Need for high-frequency and/or low-latency data access
  • Data sovereignty requirements
  • Integration with legacy systems

It’s also possible to use a custom database so that the source of truth be the external database. In this scenario there is minimal data stored in Auth0 and the user profiles are just a reflection of the profile returned from the custom database on the last login.

3 Likes