I have the following requirement:
User makes a call to my service. My service makes a call to an external service, gets a response.
My service returns an internal responseId and the responseCode from the external service to the user.
My service should be highly scalable, with low latency, and should give a fast response.
There is no performance improvement I can make to the external service.
However I need to generate a response Id.
Is this approach the best -
Create 2 threads, the first one makes a call to the database to get the next number from a sequence.
The second one makes a call to the external service.
Are there any better solutions out there for getting the response Id?