Talk about mongo, FS2 and reactive streams

1 minute read 21 December 2021

At the scala meetup in Berlin, I presented my investigation on how the mongo java driver, reactive streams and FS2 are working together.

By comparing akka-stream and fs2, I could find out a difference in how many elements are asked to the reactive publisher. That resulted in much more mongo queries when using FS2.

This whole investigation resulted in a new API in FS2. With this change, FS2 is now capable of consuming a reactive stream publisher by asking more than one element at a time. When used with the mongo java driver, it results in less queries fetching each more documents.