I am using Node js for creating a REST API.
In my scenario i have two API's.
API 1 --> Have to get 10,000 records and make a iteration to modify some of the data
API 2: Simple get method.
When i open post man and hit the first API and Second API parallel Because of Node JS is single threaded Which Causes second API slower for getting response.
My Expectation: Even though the 1st API getting time it should not make the 2nd API for large time.
From Node JS docs i have found the clustering concept. https://nodejs.org/dist/latest-v6.x/docs/api/cluster.html So i implemented Cluster it created 4 server instance. Now i hit the API 1 in one tab and API 2 in second tab it worked fine. But when i opened API 1 in 4 tabs and 5th tab again API 2 which causes the slowness again.
What will be the best solution to solve the issue?