Hello @brett19 thank you for all your help.
I’m trying to put together a demo for some colleagues to illustrate among other things the upshot of this discussion, and so I wrote the attached script to demo the timing differences between the query vs direct approach.
I’m getting strange results in that it seems the performance is practically exactly the same, meaning timing results within single digit ms and with which approach coming in first being completely hit or miss.
The topology is a straightforward 1 query node, 1 data node deployment, with both nodes on separate AWS spot instances.
The only explanation I can conjure is that since I’m testing over fios (pinging the query node/data node results in 10-20ms) the network hop gain is counter balanced by some overhead in the node sdk batching process vs the c/go/whatever form of the sdk that the query engine uses. But I am also trying with large doc payloads, which slows the timings down across the test runs (and should exacerbate the extra network hop cost) but am getting the same roughly equivalent performance statistics as above.
Can you take a look at my small script and maybe shed a bit of light about where my approach went wrong?
demo.zip (908 Bytes)