What do you do to then query the data?
I usually need indexes so queries are not slow.
Perhaps I could insert into a staging table then bulk copy the data over to an indexed table, but that seems silly.
I gave more detail with a toy example here: https://news.ycombinator.com/item?id=39245416
I've since played around with this a little more and you can do it pretty generically (at least make the worker generic where you give it a function `Chunk[A] => Task[Chunk[Result[B]]]` to do the database logic). I don't have that handy to post right now, but probably you're not using Scala anyway so the details aren't that relevant.
I've tried out a similar thing in Rust and it's a lot more finicky but still doable there. Should be similar in go I'd think.
You could use partitions though.