Is the user/registration endpoint safe for concurrent calls?
-
I need to register a user across multiple applications (8 in my case) using the
/api/user/registrationendpoint. To improve performance, I'd like to make these calls in parallel rather than sequentially.Question: Is it safe to call the
user/registrationendpoint concurrently for the same user across different applications? Could this cause:- Race conditions with the database
- Duplicate records
- Conflicting updates to the user object
Or should I stick with sequential calls to avoid potential issues?
-
The
/api/user/registrationendpoint can be problematic when called concurrently for the same user. FusionAuth recommends using sequential calls.Recommendation: Make your registration calls sequentially, one after another, even though it may take slightly longer. This ensures data consistency and avoids potential conflicts or failures during the registration process.
There is currently no single API call to atomically register a user to multiple applications. Each registration to an application requires a separate API call, and sequential execution is the safest approach.
Related Documentation
- User Registration API - Overview of the registration API and available operations
- Create a User Registration (for an existing user) - API documentation for creating registrations
- Registrations Core Concept - Understanding the relationship between Users and Applications
- Applications - Core concepts about Applications in FusionAuth
- Registering a user to other applications during registration - Community discussion on this topic
-
D dan has marked this topic as solved