I am developing an application using NodeJS where two queries depend on each other here is explanation of my situation.
I have to query database for some values say A then I have to query database for some other value B only if there is an A in the database.
I know I can do this in NodeJS' natural way like execute query for A when its result is ready execute query for B in A's callback and then finally render response in B's callback.
Here is my question, is there a design issue in the solution I just mentioned perhaps about nested callbacks.
Second is there any method in which I can make NodeJs IO as Blocking from NON-Blocking?