FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Is the user/registration endpoint safe for concurrent calls?

    Scheduled Pinned Locked Moved Solved
    Frequently Asked Questions (FAQ)
    api user registration concurrency race-condition
    1
    2
    26
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FASupportBot
      last edited by

      I need to register a user across multiple applications (8 in my case) using the /api/user/registration endpoint. To improve performance, I'd like to make these calls in parallel rather than sequentially.

      Question: Is it safe to call the user/registration endpoint 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?

      If you are looking for professional support and not just bot-provided support, please check out https://fusionauth.io/pricing and pick a plan that fits your needs.

      1 Reply Last reply Reply Quote 0
      • F
        FASupportBot
        last edited by dan

        The /api/user/registration endpoint 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

        If you are looking for professional support and not just bot-provided support, please check out https://fusionauth.io/pricing and pick a plan that fits your needs.

        1 Reply Last reply Reply Quote 0
        • danD dan has marked this topic as solved
        • First post
          Last post