In principle all you need to do is find or implement an appropriate RecordReader. DataSetIterators build from record readers by default load the data asynchronously.
As someone who has implemented several custom data set iterators, I can tell you that there are very few reasons to actually do it. And when you’re doing it, there are plenty of ways that you can mess it up.
As you’ve got your data in a database, I guess you will be able to connect to it via JDBC, so in principle you don’t even need a custom record reader, because a JDBC Record Reader already exists:
It isn’t exactly the best documented thing, but there are a few examples of using it in the tests:
To create a dataset iterator from it, you use the same RecordReaderDataSetIterator as with any other record reader and you’ll get a well working iterator without all the headache.