Skip to content

Should I add field level data fetchers if my document type fields all come from a single Mongo document? #757

Answered by paulbakker
Ericnunez asked this question in Q&A
Discussion options

You must be logged in to vote

I would do the extra processing in the document data fetcher. That's the unit of data you're loading from your database anyway, so there's no point in trying to split that up in multiple datafetchers.

If the processing is CPU expensive, you could consider to make the datafetcher async, and run the post processing on a worker pool using completable futures. However, that's an optimization that I would only use if you actually get any gains out of parallelizing this, otherwise it just complicates things for no reason.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ericnunez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants