I use a third party API on my webapp that is accessed when the user requests a particular ressource. I'm worried that the successive API calls happening upon user's request might cause the user to wait a very long time and slow down my system (since the thread processing the initial request is also waiting on these API calls to return).
so basically client -> server ->x3 third party API (three successive calls are needed)
Details: these API calls login in the user with the 3rd party system and return a session token. Currently using Django in the backend.
Is doing this synchronously always a bad idea this way? I've considered creating an asynchronous architecture instead and serving it to the user via websocket, but I'm hesitating because of the perceived added complexity of design.
might cause the user to wait a very long time and slow down my system
. Seems premature optimization to me. Take a look to this question.