nautilus/gateway

Support batching in underlying services to avoid N+1 problem

obukhov opened this issue · 3 comments

In case if implementing service resolves the fields of the type other service returns as a list (i.e. service A returns a list of ordered products and service B implements product fields resolution). This may lead to a high amount of requests per second to service B. To optimize that it would be nice to have an option to implement batching (in the service B) so all the requests caused by the same incoming query can be resolved as one batch query.

Hey @obukhov!

I took a stab at adressing this awhile ago with the introduction of the MultiOpQueryer which performs the "Transport Level Batching" described here.

Please let me know if that addresses your needs. If not, I'd love to see what we can add to support them :)

fwiw, this is documented here: https://gateway.nautilus.dev/advanced/batching

I'm going to close this issue, please let me know if there's anything else we can add to improve this support