Skip to main content

Posts

Showing posts from April, 2020

On Spring Webflux and R2DBC

Recently I dabbled with Spring Webflux and Spring Data R2DBC for a while. I compiled a few notes for myself after the exercise. R2DBC (the reactive driver for RDBMSs) is still in its nascent stage. It does not support a lot of features that we take for granted in other drivers. For a truly reactive application I think it is important to not let any flow 'cache' data. Instead every function should take reactive inputs and give reactive outputs. We should take care that there are no breaks in the chain of input and output of a reactive function. One of the core insights I learnt in this implementation is that the client which is calling the webservice is the ultimate subscriber to the reactive flows in our code. The client supplies data in a reactive request object which is then mapped to in our code via various transformations to other reactive types, and finally returned as a reactive type to our client, who again pulls (or subscribes to) this data from the server bac...